1 (edited by Spångberg 2011-07-10 23:06:34)

Topic: [SOLVED] Ignore trash folder in quota

Hi
I'm running iRedmail (0.7.2) on Ubuntu 10.04.

I would like to ignore the trash folder in users quota.

I tried to config it in dovecot.conf doesn't seem to work.

plugin {
    quota = maildir

    # Quota rules. Reference: http://wiki.dovecot.org/Quota/1.1
    # The following limit names are supported:
    #   - storage: Quota limit in kilobytes, 0 means unlimited.
    #   - bytes: Quota limit in bytes, 0 means unlimited.
    #   - messages: Quota limit in number of messages, 0 means unlimited. This probably isn't very useful.
    #   - backend: Quota backend-specific limit configuration.
    #   - ignore: Don't include the specified mailbox in quota at all (v1.1.rc5+).
    quota_rule = Trash:ignore
}

Any ideas?

Cheers!
// Tomas

2

Re: [SOLVED] Ignore trash folder in quota

quota_rule is overrode in /etc/dovecot/dovecot-mysql.conf or /etc/dovecot/dovecot-ldap.conf, so please change them instead. If no per-user quota rules found, Dovecot will use 'quota_ruleX' in dovecot.conf.

For example, with OpenLDAP backend, you have /etc/dovecot/dovecot-ldap.conf, update it with 'Trash:ignore' like below:

user_attrs      = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore

With MySQL backend, update /etc/dovecot/dovecot-mysql.conf:

user_query = SELECT ... \
                   CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
                   'Trash:ignore' AS quota_rule2 \
                   FROM ...

3

Re: [SOLVED] Ignore trash folder in quota

Worked perfect!
Thanks!

4

Re: [SOLVED] Ignore trash folder in quota

Created an simple FAQ page based on your issue:
http://www.iredmail.org/wiki/index.php? … r.in.Quota

5

Re: [SOLVED] Ignore trash folder in quota

Hi,

What would be the format to add Junk to this too?  So, ignore both Trash and Junk folders in quota?  BTW, I use LDAP, but I imagine this may benefit MySQL people too.

6

Re: [SOLVED] Ignore trash folder in quota

copart wrote:

What would be the format to add Junk to this too?  So, ignore both Trash and Junk folders in quota?

Yes.

7

Re: [SOLVED] Ignore trash folder in quota

Do you have a cron job that cleans out Trash and junk?   If not, it won't take long for your users to start playing quota games by abusing the omitted folders.   How much Trash/Junk history do you really want to maintain in your server backups?

Just a suggestion that it might be better to implement policies regarding trash/junk retention rather than omit them from quotas.  If a user gets a particularly large file that eats quota and they want to delete it, they just have to wipe it from the Trash folder to get their quota back.

8

Re: [SOLVED] Ignore trash folder in quota

bmackay wrote:

Do you have a cron job that cleans out Trash and junk?   If not, it won't take long for your users to start playing quota games by abusing the omitted folders.   How much Trash/Junk history do you really want to maintain in your server backups?

Just a suggestion that it might be better to implement policies regarding trash/junk retention rather than omit them from quotas.  If a user gets a particularly large file that eats quota and they want to delete it, they just have to wipe it from the Trash folder to get their quota back.

I ignore Junk and Trash from backups, so not concerned about that space.  I do have a cron that deletes email from Junk/Trash after a certain age.  Issue is a lot of people are using smartphones which make managing your trash more complicated.