[Dovecot] quota percents
I've noticed that http://wiki2.dovecot.org/Quota/Configuration is out of date, it says:
plugin { quota = maildir:User quota quota_rule = *:storage=1GB # 10% of 1GB = 100MB quota_rule2 = Trash:storage=10%% # 20% of 1GB = 200MB quota_rule3 = Spam:storage=20%% }
but if you use the '10%%' notation, dovecot complains, and *also* incorrectly:
dovecot: imap(test@example.net): Warning: quota root mail quota rule Trash:bytes=10%: obsolete configuration for rule 'bytes=10%' should be changed to 'bytes=+10%'
its incorrect because if you change it to what it suggests ('+10%') it wont work because that wont be 10% more, rather, it is set to bytes=+10:
dovecot: imap(test@example.net): Debug: Quota rule: root=mail quota mailbox=Trash bytes=+10 messages=0
clearly, that isn't right... so I guess it needs to be changed to '+10%%', setting that provides:
dovecot: imap(test@example.net): Debug: Quota rule: root=mail quota mailbox=* bytes=2211724 messages=0 dovecot: imap(test@example.net): Debug: Quota rule: root=mail quota mailbox=Trash bytes=+221172 (10%) messages=0
that seems ok, its saying the Trash mailbox is set to have 221172bytes (215 kilobytes) of quota. So, clearly http://wiki2.dovecot.org/Quota/Configuration needs to be updated.
However, it doesn't seem to work in practice, because I have a user that is at 99% of quota, with nothing in the Trash who cannot move a 77KB message into the Trash without getting the quota_exceeded message and refusing to move it.
so... how do I get this to work?
thanks! micah
--
On Fri, 2011-09-09 at 16:05 -0400, Micah Anderson wrote:
I've noticed that http://wiki2.dovecot.org/Quota/Configuration is out of date, it says:
plugin { quota = maildir:User quota quota_rule = *:storage=1GB # 10% of 1GB = 100MB quota_rule2 = Trash:storage=10%% # 20% of 1GB = 200MB quota_rule3 = Spam:storage=20%% }
but if you use the '10%%' notation, dovecot complains, and *also* incorrectly:
dovecot: imap(test@example.net): Warning: quota root mail quota rule Trash:bytes=10%: obsolete configuration for rule 'bytes=10%' should be changed to 'bytes=+10%'
Right, fixed in wiki. Although this was only a warning, so it still worked.
its incorrect because if you change it to what it suggests ('+10%') it wont work because that wont be 10% more, rather, it is set to bytes=+10:
Well, that's a more complex problem. The %% escaping needs to be done in dovecot.conf, but it doesn't need to be done elsewhere. If this said that "use +10%%" and someone gives that in SQL user_query, it will break. So I'm not changing the warning.
However, it doesn't seem to work in practice, because I have a user that is at 99% of quota, with nothing in the Trash who cannot move a 77KB message into the Trash without getting the quota_exceeded message and refusing to move it.
dovecot -n output?
Timo Sirainen <tss@iki.fi> writes:
On Fri, 2011-09-09 at 16:05 -0400, Micah Anderson wrote:
its incorrect because if you change it to what it suggests ('+10%') it wont work because that wont be 10% more, rather, it is set to bytes=+10:
Well, that's a more complex problem. The %% escaping needs to be done in dovecot.conf, but it doesn't need to be done elsewhere. If this said that "use +10%%" and someone gives that in SQL user_query, it will break. So I'm not changing the warning.
Ok, that makes sense.
However, it doesn't seem to work in practice, because I have a user that is at 99% of quota, with nothing in the Trash who cannot move a 77KB message into the Trash without getting the quota_exceeded message and refusing to move it.
dovecot -n output?
NOTE: i turned off the quota plugins while this is sorted, so you wont see them enabled below.
# 2.0.13: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.2 auth_default_realm = example.net auth_verbose = yes default_process_limit = 256 default_vsz_limit = 512 M dict { expire = mysql:/etc/dovecot/dovecot-dict-sql.conf quota = mysql:/etc/dovecot/dovecot-dict-sql.conf } disable_plaintext_auth = no first_valid_gid = 8 first_valid_uid = 8 last_valid_gid = 8 last_valid_uid = 8 listen = * login_greeting = howdy, ready. mail_location = mdbox:~/mdbox mail_plugins = expire maildir_very_dirty_syncs = yes namespace { inbox = yes location = prefix = separator = . } namespace { hidden = yes inbox = no list = no location = prefix = INBOX. separator = . } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { expire = Trash expire2 = Trash/* expire3 = Spam expire_dict = proxy::expire quota = dict:Your mail quota::proxy::quota quota_exceeded_message = You are over quota. To avoid losing mail, immediately empty your Trash and Sent folders and delete emails with large attachments. quota_rule = *:bytes=24117248 quota_rule2 = Trash:bytes=+50%% quota_rule3 = Spam:bytes=+20%% } postmaster_address = postmaster@example.net protocols = imap pop3 service dict { unix_listener dict { group = mail mode = 0600 user = mail } } service imap-login { process_min_avail = 10 service_count = 0 vsz_limit = 512 M } service imap-postlogin { executable = script-login /maildir/postlogin_imap user = $default_internal_user } service pop3-postlogin { executable = script-login /maildir/postlogin_pop user = $default_internal_user } ssl_cert = </etc/certs/wildcard/cert.pem ssl_cipher_list = HIGH:-ADH:-aNULL ssl_key = </etc/certs/wildcard/key.pem userdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } verbose_proctitle = yes protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep mail_plugins = expire } protocol pop3 { pop3_client_workarounds = outlook-no-nuls oe-ns-eoh pop3_uidl_format = %g }
On 12.9.2011, at 19.17, Micah Anderson wrote:
However, it doesn't seem to work in practice, because I have a user that is at 99% of quota, with nothing in the Trash who cannot move a 77KB message into the Trash without getting the quota_exceeded message and refusing to move it.
dovecot -n output?
namespace { inbox = yes location = prefix = separator = . } namespace { hidden = yes inbox = no list = no location = prefix = INBOX. separator = . }
Maybe the client is using the INBOX. namespace and trying to copy to INBOX.Trash instead of Trash? You could try adding another quota rule for INBOX.Trash. I should probably also change the quota code to follow "alias_for" directives. Then you could have only a single Trash, if you add "alias_for = " to the INBOX. namespace.
Timo Sirainen <tss@iki.fi> writes:
On 12.9.2011, at 19.17, Micah Anderson wrote:
However, it doesn't seem to work in practice, because I have a user that is at 99% of quota, with nothing in the Trash who cannot move a 77KB message into the Trash without getting the quota_exceeded message and refusing to move it.
dovecot -n output?
namespace { inbox = yes location = prefix = separator = . } namespace { hidden = yes inbox = no list = no location = prefix = INBOX. separator = . }
Maybe the client is using the INBOX. namespace and trying to copy to INBOX.Trash instead of Trash? You could try adding another quota rule for INBOX.Trash. I should probably also change the quota code to follow "alias_for" directives. Then you could have only a single Trash, if you add "alias_for = " to the INBOX. namespace.
ok, I made an INBOX.Trash quota rule:
90-quota.conf: quota_rule = *:bytes=24117248 90-quota.conf: quota_rule2 = Trash:bytes=+10%% 90-quota.conf: quota_rule2 = INBOX.Trash:bytes=+10%% 90-quota.conf: quota_rule3 = INBOX.Spam:bytes=+20%%
and that seemed to solve the problem!
micah
ps - its very annoying to test quota with thunderbird, it doesn't update the information very reliably.
--
participants (2)
-
Micah Anderson
-
Timo Sirainen