[Dovecot] Dovecot - Issue with Maildir++ quotas
Hi,
I've been bitten by an issue running Squirrelmail on top of Dovecot using Maildir++ quotas.
Having configured these quotas in Dovecot, I notice that Dovecot appears not to exclude the 'Trash' folder from its quota calculation (which it should do, according to the Maildir++ spec). Unfortunately this breaks Squirrelmail if I try to delete a message from a close-to-quota mailbox - as per July's thread: "Maildir++ quota - how to handle a full mailbox"
Which unfortunately means that a fairly full mailbox can become 'Wedged' with Dovecot/Squirrelmail in this situation with its owner unable to delete messages if that's the only way they access their mailbox.
I took a look at the source and found the 'Quota exceeded' lines in src/plugins/quota/quota-storage.c but didn't understand it well enough to dive in... except to notice that the 'Trash' folder doesn't appear to get excluded from the calculations.
cheers,
Andrew.
On Friday 11 August 2006 19:24, Andrew Richards wrote:
I've been bitten by an issue running Squirrelmail on top of Dovecot using Maildir++ quotas.
Having configured these quotas in Dovecot, I notice that Dovecot appears not to exclude the 'Trash' folder from its quota calculation (which it should do, according to the Maildir++ spec). Unfortunately this breaks Squirrelmail if I try to delete a message from a close-to-quota mailbox - as per July's thread: "Maildir++ quota - how to handle a full mailbox"
Which unfortunately means that a fairly full mailbox can become 'Wedged' with Dovecot/Squirrelmail in this situation with its owner unable to delete messages if that's the only way they access their mailbox.
I took a look at the source and found the 'Quota exceeded' lines in src/plugins/quota/quota-storage.c but didn't understand it well enough to dive in... except to notice that the 'Trash' folder doesn't appear to get excluded from the calculations.
To reply to my own query:
I've mis-quoted the Maildir++ spec - the Maildir++ Trash folder is ".Trash", which differs from ".INBOX.Trash" - so the latter shouldn't necessarily be excluded from the quota calculation.
I still wanted to get Squirrelmail working (with deleting mails when near/at quota when using Maildir++ quotas), even to the extent that quotas might not be enforced during the Squirrelmail/IMAP session. Therefore I've dug into the source and worked out how to temporarily double the quota during the session (well I think that's the effect of my modification) - I've attached the relevant patch file for this should anyone else be struggling with the same problem - your mileage may vary. This at least gets Squirrelmail working.
I think a good feature to avoid having to do a kludge like this would be to add an option to the quota section of dovecot.conf where the Trash folder could be specified as not counting towards the quota.
cheers,
Andrew.
On Tuesday 15 August 2006 13:28, Andrew Richards wrote:
On Friday 11 August 2006 19:24, Andrew Richards wrote:
I've been bitten by an issue running Squirrelmail on top of Dovecot using Maildir++ quotas.
Having configured these quotas in Dovecot, I notice that Dovecot appears not to exclude the 'Trash' folder from its quota calculation (which it should do, according to the Maildir++ spec). Unfortunately this breaks Squirrelmail if I try to delete a message from a close-to-quota mailbox - as per July's thread: "Maildir++ quota - how to handle a full mailbox"
Which unfortunately means that a fairly full mailbox can become 'Wedged' with Dovecot/Squirrelmail in this situation with its owner unable to delete messages if that's the only way they access their mailbox.
I took a look at the source and found the 'Quota exceeded' lines in src/plugins/quota/quota-storage.c but didn't understand it well enough to dive in... except to notice that the 'Trash' folder doesn't appear to get excluded from the calculations.
To reply to my own query:
I've mis-quoted the Maildir++ spec - the Maildir++ Trash folder is ".Trash", which differs from ".INBOX.Trash" - so the latter shouldn't necessarily be excluded from the quota calculation.
I still wanted to get Squirrelmail working (with deleting mails when near/at quota when using Maildir++ quotas), even to the extent that quotas might not be enforced during the Squirrelmail/IMAP session. Therefore I've dug into the source and worked out how to temporarily double the quota during the session (well I think that's the effect of my modification) - I've attached the relevant patch file for this should anyone else be struggling with the same problem - your mileage may vary. This at least gets Squirrelmail working.
I think a good feature to avoid having to do a kludge like this would be to add an option to the quota section of dovecot.conf where the Trash folder could be specified as not counting towards the quota.
Doh, I've just found the following, I should have looked here first:
http://www.squirrelmail.org/wiki/DisableTrashcan
which is a much simpler approach to the same problem.
cheers,
Andrew.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 15 Aug 2006, Andrew Richards wrote:
which is a much simpler approach to the same problem.
BTW: If one would disable quota from Trash: What prevents the user from using Trash to _store_ Mails? You would need some sort of automatic cleaning of the mailfolder.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux)
iQEVAwUBROHYtC9SORjhbDpvAQK6/wgAwUmQ704kPYHxiG9K2363WyAvH8XrRyEA OoJNwFfB+H38F5tlNifRHu5qe0BAOZ/EhMPErFDOwWPAHQH+TL5fsUacSnNXDscy hXc+11wiHlaqcs+MFQd8ZfoyW1eSTFgoyPymx3oqQ02a/19J3a831KJ5kNdbEbBJ 25z7JhDvCgmw1s64sxLLU9ixrVX7H0M7dwVH9jGC2FZQNEEFM2RiyX2a0KiRfvKP m300wX8hprVWAZ/Hg0ior94g4G14LQmmov90MMnbsWomSRDjlKE/CDq4SoFzrdS2 ZqPyNxO5uMxSNkXhx4H3Cgbh9xHHeMF6WobRYOc0ogVjwnBTKvO5Vg== =tQhj -----END PGP SIGNATURE-----
On Tuesday 15 August 2006 15:22, Steffen Kaiser wrote:
On Tue, 15 Aug 2006, Andrew Richards wrote:
which is a much simpler approach to the same problem.
BTW: If one would disable quota from Trash: What prevents the user from using Trash to _store_ Mails? You would need some sort of automatic cleaning of the mailfolder.
Absolutely! I'd setup a cron job crawling users mailboxes for over-quota mailboxes, deleting messages in Trash folders when this is found. Dovecot's "Trash" plugin may also be useful to recycle the space...
cheers,
Andrew.
Absolutely! I'd setup a cron job crawling users mailboxes for over-quota mailboxes, deleting messages in Trash folders when this is found. Dovecot's "Trash" plugin may also be useful to recycle the space...
I do that, for Trash and Spam and the like. (Or, I did, with cyrus, up to this weekend.. I need to retool that a touch)
On August 16, 2006 3:22:58 AM -0700 Frank Cusack fcusack@fcusack.com wrote:
Absolutely! I'd setup a cron job crawling users mailboxes for over-quota mailboxes, deleting messages in Trash folders when this is found. Dovecot's "Trash" plugin may also be useful to recycle the space...
Oh, what does this do? It's not documented on the wiki.
Oh sorry, it is documented after all. It's just not listed on the main wiki page. If you go to the plugins page, it's there.
There are other plugins not on the main wiki page as well.
-frank
On Fri, 2006-08-11 at 19:24 +0100, Andrew Richards wrote:
Having configured these quotas in Dovecot, I notice that Dovecot appears not to exclude the 'Trash' folder from its quota calculation (which it should do, according to the Maildir++ spec).
Well, I don't agree with Maildir++ spec in here since Dovecot doesn't do automatic cleaning of Trash.
For Dovecot v1.1 you can configure quota separately for different mailboxes:
# Quota limits are set using "quota_rule" parameters, either in here or in # userdb. It's also possible to give mailbox-specific limits, for example: # quota_rule = *:storage=1048576 # quota_rule2 = Trash:storage=102400 # User has now 1GB quota, but when saving to Trash mailbox the user gets # additional 100MB.
It also contains expire plugin:
# Expire plugin. Mails are expunged from mailboxes after being there the # configurable time. The first expiration date for each mailbox is stored in # a dictionary so it can be quickly determined which mailboxes contain # expired mails. The actual expunging is done in a nightly cronjob, which # you must set up: # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool #expire = Trash 7 Spam 30 #expire_dict = db:/var/lib/dovecot/expire.db
participants (5)
-
Andrew Richards
-
Frank Cusack
-
Jason Fesler
-
Steffen Kaiser
-
Timo Sirainen