[Dovecot] Does quota-status respect quota_grace?
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@test.info): Debug: Effective uid=1010, gid=1007, home=/home/mailboxes/t/e/test.info/test/ dovecot: quota-status(test@test.info): Debug: Quota root: name=Domain quota backend=fs args=group:inode_per_mail dovecot: quota-status(test@test.info): Debug: Quota rule: root=Domain quota mailbox=* bytes=15728640 messages=150 dovecot: quota-status(test@test.info): Debug: Quota grace: root=Domain quota bytes=2831155 (18%) dovecot: quota-status(test@test.info): Debug: Quota root: name=Mailbox quota backend=fs args=user:inode_per_mail dovecot: quota-status(test@test.info): Debug: Quota rule: root=Mailbox quota mailbox=* bytes=11534336 messages=110 dovecot: quota-status(test@test.info): Debug: Quota grace: root=Mailbox quota bytes=2076180 (18%) dovecot: quota-status(test@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@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@test.info): Debug: fs quota add mailbox dir = /home/mailboxes/t/e/test.info/test dovecot: quota-status(test@test.info): Debug: fs quota block device = /dev/sdc1 dovecot: quota-status(test@test.info): Debug: fs quota mount point = /home dovecot: quota-status(test@test.info): Debug: fs quota mount type = ext4
Am 19.12.2013 09:54, schrieb Jiri Bourek:
quota2_grace = 18%% quota_grace = 18%%
i am not sure ,you can have two quota2_grace rules, that should be a universal parameter
perhaps you mixed somthing with lda/lmtp overquota rules
please reread
http://wiki2.dovecot.org/Quota/Configuration
and/or wait for Timos answer
Best Regards MfG Robert Schetterer
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Robert Schetterer wrote:
Am 19.12.2013 09:54, schrieb Jiri Bourek:
quota2_grace = 18%% quota_grace = 18%%
i am not sure ,you can have two quota2_grace rules, that should be a universal parameter
Documentation doesn't mention anything about multiple quota_grace rules explicitly (or I missed it), but from what I've tried, it works. For example if I comment out the quota_grace, default 10% is used for one quota while the other stays 18%
From the debug log with quota_grace removed: Debug: Quota grace: root=Domain quota bytes=104857600 (10%) Debug: Quota grace: root=Mailbox quota bytes=2076180 (18%)
Am 19.12.2013 10:33, schrieb Jiri Bourek:
Robert Schetterer wrote:
Am 19.12.2013 09:54, schrieb Jiri Bourek:
quota2_grace = 18%% quota_grace = 18%%
i am not sure ,you can have two quota2_grace rules, that should be a universal parameter
Documentation doesn't mention anything about multiple quota_grace rules explicitly (or I missed it), but from what I've tried, it works. For example if I comment out the quota_grace, default 10% is used for one quota while the other stays 18%
From the debug log with quota_grace removed: Debug: Quota grace: root=Domain quota bytes=104857600 (10%) Debug: Quota grace: root=Mailbox quota bytes=2076180 (18%)
if its not in docs, it may not work as you expected
Best Regards MfG Robert Schetterer
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
On 19.12.2013, at 10.54, Jiri Bourek bourek@thinline.cz wrote:
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.
http://hg.dovecot.org/dovecot-2.2/rev/be98fec32cd8 should help.
Timo Sirainen wrote:
On 19.12.2013, at 10.54, Jiri Bourekbourek@thinline.cz wrote:
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.
http://hg.dovecot.org/dovecot-2.2/rev/be98fec32cd8 should help.
It does, thanks a lot
participants (3)
-
Jiri Bourek
-
Robert Schetterer
-
Timo Sirainen