[Dovecot] quota not being calculated
It looks like my quota isnt being calculated properly after I started setting quota to a specific folder. The quota in that folder is always starting out at 0, and only new email is being added to the quota. If I remove the maildirsize file, and recalculate, it still starts at 0. Once email arrives in the folder, it gets added to maildirsize. This is with maildirquota, in perhaps a bit of an exotic config. The idea is to set a specific quota to Spam folder, using the trash plugin to keep it at a certain size.
. getquotaroot "Spam"
- QUOTAROOT "Spam" "User quota" "Spam quota"
- QUOTA "User quota" (STORAGE 40848 1228800)
- QUOTA "Spam quota" (STORAGE 0 20000) . OK Getquotaroot completed.
Once 1 email gets added:
.Spam# cat maildirsize 20480000S 0 0 2017 1
namespace { hidden = no ignore_on_failure = no inbox = yes list = yes location = maildir:%h:INDEX=/var/spool/mail/dovecot-control/indexes/%1u/%2u/%u:CONTROL=/var/spool/mail/dovecot-control/%1u/%2u/%u/INBOX prefix = separator = / subscriptions = yes type = private } namespace spam { hidden = yes ignore_on_failure = no inbox = no list = yes location = maildir:%h/.Spam:INDEX=/var/spool/mail/dovecot-control/indexes/%1u/%2u/%u/.Spam:CONTROL=/var/spool/mail/dovecot-control/%1u/%2u/%u/.Spam prefix = Spam/ separator = / subscriptions = no type = private }
plugin { quota = fs:User quota quota2 = maildir:Spam quota:ns=Spam/ quota2_rule = *:storage=20000K sieve = /var/spool/mail/dovecot-control/sieve/%1u/%2u/%u/dovecot.sieve sieve_before = /etc/sieve/before sieve_dir = /var/spool/mail/dovecot-control/sieve/%1u/%2u/%u/scripts trash = /etc/dovecot/conf.d/dovecot-trash.conf.ext }
(full config: http://pastebin.com/Mui4X7Zh)
On 20.4.2012, at 19.05, Cor Bosman wrote:
It looks like my quota isnt being calculated properly after I started setting quota to a specific folder. The quota in that folder is always starting out at 0, and only new email is being added to the quota. If I remove the maildirsize file, and recalculate, it still starts at 0. Once email arrives in the folder, it gets added to maildirsize. This is with maildirquota, in perhaps a bit of an exotic config. The idea is to set a specific quota to Spam folder, using the trash plugin to keep it at a certain size.
I'll try later, but try if it would work with dict quota file? http://wiki2.dovecot.org/Quota/Dict
It looks like my quota isnt being calculated properly after I started setting quota to a specific folder. The quota in that folder is always starting out at 0, and only new email is being added to the quota. If I remove the maildirsize file, and recalculate, it still starts at 0. Once email arrives in the folder, it gets added to maildirsize. This is with maildirquota, in perhaps a bit of an exotic config. The idea is to set a specific quota to Spam folder, using the trash plugin to keep it at a certain size.
I'll try later, but try if it would work with dict quota file? http://wiki2.dovecot.org/Quota/Dict
This almost works, but maybe there's a small bug. Config (2.1.4)
namespace spam { type = private separator = / inbox = no prefix = Spam/ location = maildir:%h/.Spam:INDEX=/var/spool/mail/dovecot-control/indexes/%1u/%2u/%u/.Spam:CONTROL=/var/spool/mail/dovecot-control/%1u/%2u/%u/.Spam subscriptions = no list = yes hidden = yes }
plugin { quota = fs:User quota quota2 = dict:Spam Quota::ns=spam:file:%h/spam-quota quota2_rule = *:storage=20M }
Now I see:
. getquotaroot "Spam"
- QUOTAROOT "Spam" "User quota" "Spam Quota"
- QUOTA "User quota" (STORAGE 10128 1228800)
- QUOTA "Spam Quota" (STORAGE 8727 20480)
The problem is that the storage calculated for the spam ns is wrong. It is less than 1MB. The 8727 seems to be the whole maildir including all folders.
This seems to be caused by:
Apr 21 10:00:11 lmtp1 dovecot: imap(cor): Error: quota: Unknown namespace: spam
Regards,
Cor
On 21.4.2012, at 11.01, Cor Bosman wrote:
prefix = Spam/ .. quota2 = dict:Spam Quota::ns=spam:file:%h/spam-quota .. Apr 21 10:00:11 lmtp1 dovecot: imap(cor): Error: quota: Unknown namespace: spam
Oh. It would make more sense to have ns=spam, but unfortunately I hadn't thought of namespace names before v2.1. You need to use ns=Spam/
On Apr 21, 2012, at 12:32 PM, Timo Sirainen wrote:
On 21.4.2012, at 11.01, Cor Bosman wrote:
prefix = Spam/ . quota2 = dict:Spam Quota::ns=spam:file:%h/spam-quota . Apr 21 10:00:11 lmtp1 dovecot: imap(cor): Error: quota: Unknown namespace: spam
Oh. It would make more sense to have ns=spam, but unfortunately I hadn't thought of namespace names before v2.1. You need to use ns=Spam/
Exact same issue with dict quota. It starts out at 0 (even though there are 116 messages in the Spam folder. Then when 1 email gets saved to the Spam folder, the counter is increased by the size of that 1 email.
Cor
On 21.4.2012, at 13.42, Cor Bosman wrote:
On Apr 21, 2012, at 12:32 PM, Timo Sirainen wrote:
On 21.4.2012, at 11.01, Cor Bosman wrote:
prefix = Spam/ . quota2 = dict:Spam Quota::ns=spam:file:%h/spam-quota . Apr 21 10:00:11 lmtp1 dovecot: imap(cor): Error: quota: Unknown namespace: spam
Oh. It would make more sense to have ns=spam, but unfortunately I hadn't thought of namespace names before v2.1. You need to use ns=Spam/
Exact same issue with dict quota. It starts out at 0 (even though there are 116 messages in the Spam folder. Then when 1 email gets saved to the Spam folder, the counter is increased by the size of that 1 email.
http://hg.dovecot.org/dovecot-2.1/rev/4c8f79d1f9f1 should fix it with dict quota.
http://hg.dovecot.org/dovecot-2.1/rev/4c8f79d1f9f1 should fix it with dict quota.
Thank you, this fixed it with dict quota.
Cor
participants (2)
-
Cor Bosman
-
Timo Sirainen