[Dovecot] domain quota in sql

Adam Szpakowski as at 3a.pl
Wed Feb 15 09:26:28 EET 2012

On 15.02.2012 02:55, Timo Sirainen wrote:
> On 15.2.2012, at 3.54, Timo Sirainen wrote:
>> Domain-quota support in Dovecot is only partial. Recalculating domain quota would require more code. Last time when someone asked about this I wasn't even sure how it could be implemented, but nowadays it actually would be possible to do with:
> Oh, and you could actually already do this with a doveadm script:
I'm using something like this, but directly on the dbase level. 
Unfortunately such operation is quite db intensive, so I'm looking for a 
simpler solution.

Is there a way to add domainname as another collumn in dbase? This will 
simplify the SQL query and the GROUP BY could be used.

> Of course it would be nice if Dovecot internally supported this.
I was under impression, that dovecot does support this. In examples one 
can see:


# Multiple quota roots are also possible, for example this gives each user
# their own 100MB quota and one shared 1GB quota within the domain:
plugin {
   #quota = dict:user::proxy::quota
   #quota2 = dict:domain:%d:proxy::quota_domain

Also on dovecot2 wiki we can see (http://wiki2.dovecot.org/Quota/Dict):

"If username is left empty, the logged in username is used (this is 
typically what you want). Another useful username is '%d' for supporting 
domain-wide quotas."

Adam Szpakowski

More information about the dovecot mailing list