[Dovecot] Enforcing Dovecot Quotas

Leon Meßner l.messner at physik.tu-berlin.de
Tue May 8 23:12:49 EEST 2012


On Tue, May 08, 2012 at 01:59:38AM -0700, tcsmith1978 wrote:
> 
> Hello,
> 
> I have been looking at enforcing quotas for users of my mail system (postfix
> and Dovecot v1.2). Have tried to follow a few tuts on the web but its not
> having the desired effect. Essentially I can still send and receive mail on
> an account that I believe has had its quota exceeded.
> 
> In my main.cf, I have:
> 
> userdb sql {
>          args = /etc/dovecot/mysql/dovecot-mysql.conf
> }
> passdb sql {
>          args = /etc/dovecot/mysql/dovecot-mysql.conf
> }
> 
> and...
> 
> protocol lda {
>         mail_plugins = quota
> }
> 
> protocol imap {
>         mail_plugins = quota imap_quota
> }
> 
> plugin {
>         quota_exceeded_message = You have exceeded the maximum quota for
> your mailbox
> }
> 
> the dovecot sql (mysql) file has the following query for pulling out user
> ids and quotas etc:
> 
> user_query = SELECT maildir, mymailuser as uid, mymailgroup as
> gid,concat('maildir:storage=',quota) as quota FROM virtual_mailbox WHERE
> username = '%u'
> 
> I have set one of my users to have a quota of 1 (so one byte I believe) so
> it should be over the limit pretty much immediately.
> 
> Looking at the logs I can see that the system is picking up on the quota
> limit but doesn't seem to enforce it.
> 
> Apr 27 10:29:02 deliver(test at testdomain.com): Info: auth input:
> quota=maildir:storage=1
> Apr 27 10:29:02 deliver(test at testdomain.com): Info: Quota root:
> name=storage=1 backend=maildir args=
> 
> Any ideas? Am i missing something?

i would try something like in the wiki:
plugin {
	quota = maildir:User quota
	quota_exceeded_message = You have exceeded
}

Never used mysql for userdb or passdb though. Perhaps this would work:

user_query = SELECT maildir, mymailuser as uid, mymailgroup as
gid,concat('*:storage=',quota) as quota_rule FROM virtual_mailbox
WHERE
username = '%u


> -- 
> View this message in context: http://old.nabble.com/Enforcing-Dovecot-Quotas-tp33763561p33763561.html
> Sent from the Dovecot mailing list archive at Nabble.com.
> 



More information about the dovecot mailing list