0

I have dicovered that standard quota implementation on maildir++ operated by maildrop and courier-imap (installed on ubuntu machine) does not count mails in a .Trash directory.

Users now have almost unlimited mail space. Is there any option to disable this bad behavior without recompiling maildrop and imap packages?

If not, how i can do this on ubuntu 12.10?

Edit:

ive recompiled maildrop and courier-imap packages with

DEB_BUILD_OPTIONS="--with-trashquota" fakeroot debian/rules binary

and nothing changes, trash is still unlimited.

Edit2:

More information according to mr.spuratic question in comments:

  • User information are stored in a PostgreSQL database.
  • Yes, all users has maildirsize in their maildirs, and quota is working (webmail and thunderbird shows right values)
  • Yes, im using maildrop
WombaT
  • 157
  • 1
  • 9
  • Did you blow away the `maildirsize` cache files too? The contents of that may be stale, delete it for a test user then it will be recreated with (hopefully) the correct usage calculation. – mr.spuratic Jan 29 '13 at 13:38
  • yes, deleted old and recreated - trash still unlimited – WombaT Jan 29 '13 at 14:55
  • `maildrop -v` won't confirm the option, so run this against **unstripped** binaries, `make install` likely stripped them so you'll need to find the build dir, then: `nm --size-sort ./maildrop/maildrop | fgrep maildirquota_count`. If the symbols sizes are low (<20) then `--with-trashquota` is enabled (those functions do nothing in that case). You did re-install, and restart `imapd`, and both the `maildrop` and `imapd` binaries are definitely the new ones? – mr.spuratic Jan 29 '13 at 15:07
  • I did not `make install`, command in my question produced *.deb files which i have installed and rebooted whole system. Result of `nm` that you posted is this: `000000a3 T maildirquota_countfile 000000a5 T maildirquota_countfolder` – WombaT Jan 30 '13 at 07:05
  • OK, trashquota is definitely enabled in that binary then... Are you using a local userdb or LDAP? Do all users have a `maildirsize` file in their maildir? Is quota working as expected otherwise? You are using postfix with `maildrop` as an MDA, and **not** postfix native maildir delivery? see http://www.postfix.org/MAILDROP_README.html . – mr.spuratic Jan 30 '13 at 10:19
  • please look at updated question. – WombaT Jan 30 '13 at 11:29
  • Sorry, more questions :) Which webmail SqWebmail or something else via IMAP? If it's something that accesses the maildirs directly like SqWebmail then that needs a recompile too. The problem ought not be observed with strictly Thunderbird only users in that case. – mr.spuratic Jan 30 '13 at 11:47
  • own webmail client which connects via imap. – WombaT Jan 30 '13 at 11:57
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/7317/discussion-between-mr-spuratic-and-wombat) – mr.spuratic Jan 30 '13 at 13:22

1 Answers1

1

This is by design. The reason is that otherwise you really easily end up with a situation where people can't delete their mails anymore when the quota is reached, as MUAs often don't just delete mails, but instead use the following mechanism:

  • Copy mail to .trash
  • mark copied mail as \deleted
  • expunge from original mailbox
  • maybe empty the .trash at some point, on user request, program exit or never.

If .trash is considered for quotas, this will fail.

This page gives some hints about how to change this behaviour for Courier.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Well, so its a bad design for me. Mail will be accessed only by our own webmail which handles situations like that. So i guess i need to recompile packages, but how... – WombaT Jan 29 '13 at 12:22