[Dovecot] [SOLVED] quota with: postfixadmin, postfix, mysql & dovecot

Timothy Martin tim at talking-dog.com
Sun Oct 1 19:04:08 EEST 2006


On Oct 1, 2006, at 7:17am, Peter Veerman wrote:

>
> So i'm looking for the fastest alternative to dirsize that still  
> allows
> me to have my per-user quota. I think that the quota dict is what i'm
> looking for. The problem is that i am not sure if i can use it without
> making use of the dovecot LDA. As I am not using the dovecot LDA nor
> planning to use it as i'm happy with my current LDA (postfix's).
>

To tell you the truth Peter, I too was confused by the wiki  
descriptions on how to set up quota -- and perhaps i don't have it  
set up correctly as a result. However, this is what i have configured  
and it appears to be working:

in dovecot.conf I set a default quota amount of only 10 MB (mostly to  
make it obvious if i've screwed up) and i used the maildir method for  
this since it seemed recommended method of tracking quota usage:

plugin {
	quota = maildir:storage=10240
}

and in my dovecot-sql.conf file, i return the quota from the user  
database which appears to successfully override the quota value from  
the standard conf file:

user_query = SELECT pop AS home, CONCAT('maildir:', smtp) AS mail,  
uid, gid, CONCAT('maildir:storage=', quota * 1024) AS quota FROM  
users WHERE username = '%u'

the import part of this obviuosly being:
	CONCAT('maildir:storage=', quota * 1024) AS quota

As for all those wiki statements about using dict as a backend that  
supports mysql -- I believe (and i'm guessing here) that that is  
reference to if you want to use mysql to be the storage method for  
keeping track of your current quota usage. For example, the maildir++  
backend allows the imap server to continually calculate message sizes  
and numbers while storing them in a flat human-readable text file in  
each imap mailbox. If you wanted to use a dict+mysql solution, the  
server would simply retrieve those quota usage numbers from the  
database instead.

I think the thing that would really clarify the wiki for me would be  
if we had two defined terms. "Quota Limit" as being the generally  
static value for a domain or user that sets the maximum data size or  
message count. "Quota Status" would be the values associated with  
your users current usage. In the end, you need to decide where the  
Quota Limit will be stored and retrieved, but also need to define how  
the Quota Status will be calculated/retrieved, and stored (if at all).

I'm sure there are others on the list that understand the quota  
backends better than I... but this is what i've gleaned so far.

.tim


More information about the dovecot mailing list