[Dovecot] Does quota-status respect quota_grace?

Jiri Bourek bourek at thinline.cz
Thu Dec 19 10:54:29 EET 2013


Hello,

I have Dovecot 2.2.9 from Debian repository running on AMD64, ext4 
filesystem for mail storage. Each mailbox has its own system user, 
quotas are enforced by file system. Quota settings in configuration are 
as follows (from doveconf -n):

   quota = fs:Domain quota:group:inode_per_mail
   quota2 = fs:Mailbox quota:user:inode_per_mail
   quota2_grace = 18%%
   quota_grace = 18%%
   quota_status_nouser = DUNNO
   quota_status_overquota = 552 5.2.2 Mailbox is full
   quota_status_success = DUNNO

Quota rules are read from PostgreSQL (snippet)

user_query = ...
   '*:bytes=' || domains.quota_size || 'M:messages=' || 
domains.quota_files as quota_rule, \
   '*:bytes=' || mailboxes.quota_size || 'M:messages=' || 
mailboxes.quota_files as quota2_rule, \
   ...

As far as I can tell, quota enforcing in dovecot-lda works correctly. 
User is allowed one message which brings him over quota (provided the 
message fits into filesystem quota hard limit and quota_grace value), 
every other message after that is rejected.

However policy service quota-status for Postfix seems to ignore the 
quota_grace value. When a message arrives which would make user go over 
quota (but which would not make him exceed the grace limit value), 
Postfix checks the policy service and is told to reject the message.

I checked and dovecot itself is fine with the message - if I try to send 
it with the policy service check disabled, Postfix accepts it and so 
does dovecot-lda, the message is delivered into mailbox.

My question is - is that intended behavior or bug in the quota-status?

Appending some lines from debug log - as far as I can see there's not 
much in it though:

dovecot: quota-status: Debug: Added userdb setting: 
mail=maildir:/home/mailboxes/t/e/test.info/test/:LAYOUT=fs:INDEX=/var/lib/dovecot-data/index/1010:CONTROL=/var/lib/dovecot-data/control/1010
dovecot: quota-status: Debug: Added userdb setting: 
plugin/quota2_rule=*:bytes=11M:messages=110
dovecot: quota-status: Debug: Added userdb setting: 
plugin/quota_rule=*:bytes=15M:messages=150
dovecot: quota-status(test at test.info): Debug: Effective uid=1010, 
gid=1007, home=/home/mailboxes/t/e/test.info/test/
dovecot: quota-status(test at test.info): Debug: Quota root: name=Domain 
quota backend=fs args=group:inode_per_mail
dovecot: quota-status(test at test.info): Debug: Quota rule: root=Domain 
quota mailbox=* bytes=15728640 messages=150
dovecot: quota-status(test at test.info): Debug: Quota grace: root=Domain 
quota bytes=2831155 (18%)
dovecot: quota-status(test at test.info): Debug: Quota root: name=Mailbox 
quota backend=fs args=user:inode_per_mail
dovecot: quota-status(test at test.info): Debug: Quota rule: root=Mailbox 
quota mailbox=* bytes=11534336 messages=110
dovecot: quota-status(test at test.info): Debug: Quota grace: root=Mailbox 
quota bytes=2076180 (18%)
dovecot: quota-status(test at test.info): Debug: Namespace inbox: 
type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, 
subscriptions=yes 
location=maildir:/home/mailboxes/t/e/test.info/test/:LAYOUT=fs:INDEX=/var/lib/dovecot-data/index/1010:CONTROL=/var/lib/dovecot-data/control/1010
dovecot: quota-status(test at test.info): Debug: fs: 
root=/home/mailboxes/t/e/test.info/test, 
index=/var/lib/dovecot-data/index/1010, indexpvt=, 
control=/var/lib/dovecot-data/control/1010, 
inbox=/home/mailboxes/t/e/test.info/test, alt=
dovecot: quota-status(test at test.info): Debug: fs quota add mailbox dir = 
/home/mailboxes/t/e/test.info/test
dovecot: quota-status(test at test.info): Debug: fs quota block device = 
/dev/sdc1
dovecot: quota-status(test at test.info): Debug: fs quota mount point = /home
dovecot: quota-status(test at test.info): Debug: fs quota mount type = ext4


More information about the dovecot mailing list