[Dovecot] quota: ignore deleted messages (?)

Sven Hartge sven at svenhartge.de
Fri Aug 24 15:02:05 EEST 2012


Hi!

I am currently in the process of preparing a migration of our old
Courier-based IMAP/POP server setup to a Dovecot-based one.

During this process I came across the following problem with the
difference Courier and Dovecot handle deleted messages and mail quota.

Quote from http://www.courier-mta.org/imap/README.maildirquota.html:

,----
| The default application configuration that uses this maildirquota
| library does not count deleted messages, and any contents of the Trash
| folder, against the quota. Messages that are marked as deleted (but not
| yet actually removed), or messages that are moved to the Trash folder
| (which is subject to automatic purging) do not count towards the set
| quota.
`----

Ignoring the content (or increasing the quota) of the Trash folder is
easy and no problem, but ignoring deleted messages seems impossible
without changes to the code.

While deleted messages are still stored on the server and still take up
space until they are expunged, counting them against the quota is
somewhat counter-intuitive because most clients don't show those mails
and the normal user is unaware the mails he deleted are still there and
take up space. Worse yet, if the client uses move-to-Trash, a user
deleting mails will double the used space (until Expunge is used) and
this may push him over his quota and thus cause any new mail delivery to
fail.

Unfortunately as our users are used to the courier way of handling the
quota this will cause trouble after the migration.

And this setup is run at a University, so I don't have any control over
the clients a user uses and the behavior of said clients so I am not
able to disable the move-to-Trash feature or force an immediate Expunge
after a delete.

So I propose an additional flag for the quota_rule config option to be
able to enable a more lax interpretation of the quota enforcement:

  quota_rule = *:storage=1G:ignoredeleted
  quota_rule2 = Trash:storage=+100M

Of course I would then have a nightly cronjob which force-expunges all
deleted messages so that users can't store mails infinitely in their
mailboxes.

Thanks for your time and Grüße,
Sven.


-- 
Sigmentation fault. Core dumped.




More information about the dovecot mailing list