[Dovecot] Maildir++ quota: When is it recalculated?
Ulrich Zehl
ulrich-dovecot at topfen.net
Wed Jan 14 18:24:03 EET 2009
On Wed, Jan 14, 2009 at 10:18:30AM -0500, Timo Sirainen wrote:
> > but unfortunately, I'm not enough of a programmer, so I have to ask here:
> > Should I be able to delete mails from a maildir, and expect the quota
> > plugin to notice the change?
>
> I think it should notice most times, but not necessarily always. Can you
> reproduce this with simple steps? Meaning that if maildirsize file is
> either older than 15 minutes or longer than two lines, does Dovecot not
> recalculate the quota when user is over quota?
Yes, I can. However, the user is, strictly speaking, not over quota, since
there are still a few bytes free. The new message would push it over quota,
though. Does this make a difference?
These are the steps I took, starting from a "fresh" account (one whose
home directory I deleted), and using swaks[0] to generate the mails. We use
Postfix to pipe the messages to deliver, and have set
quota_full_tempfail = yes.
1. Delete the user's home directory
2. Deliver 3 messages to the user, using
# swaks -f ulrich at topfen.net -t grmpfl at example.net -s localhost
3. maildirsize now shows:
# cat Maildir/maildirsize
2000S
0 0
510 1
510 1
510 1
4. Try to deliver a fourth message (also 510 bytes). As expected, it fails.
# tail -n 2 /var/log/mail.log
Jan 14 17:15:02 carolyn deliver(grmpfl at example.net): msgid=<20090114161502.7F2AA1C104 at carolyn.beispiel.at>: save failed to INBOX: Quota exceeded (mailbox for user is full)
Jan 14 17:15:02 carolyn postfix/pipe[8461]: 7F2AA1C104: to=<grmpfl at example.net>, relay=dovecot, delay=0.18, delays=0.12/0.03/0/0.03, dsn=4.3.0, status=deferred (temporary failure. Command output: Quota exceeded (mailbox for user is full) )
5. Remove one of the files:
# rm Maildir/new/1231949258.M463705P8296.carolyn\,S\=510\,W\=524
6. Try to deliver the message again, and watch it fail again:
# postqueue -f
# tail -n 2 /var/log/mail.log
Jan 14 17:15:55 carolyn deliver(grmpfl at example.net): msgid=<20090114155631.BCDB71C0DA at carolyn.beispiel.at>: save failed to INBOX: Quota exceeded (mailbox for user is full)
Jan 14 17:15:55 carolyn postfix/pipe[8461]: BCDB71C0DA: to=<grmpfl at example.net>, relay=dovecot, delay=1164, delays=1164/0.04/0/0.02, dsn=4.3.0, status=deferred (temporary failure. Command output: Quota exceeded (mailbox for user is full) )
7. Try ageing maildirsize and a new delivery:
# touch -t 01010101 Maildir/maildirsize
# postqueue -f
# tail -n 2 /var/log/mail.log
Jan 14 17:18:42 carolyn postfix/pipe[8553]: 7F2AA1C104: to=<grmpfl at example.net>, relay=dovecot, delay=220, delays=220/0.05/0/0.03, dsn=4.3.0, status=deferred (temporary failure. Command output: Quota
exceeded (mailbox for user is full) )
Jan 14 17:18:42 carolyn postfix/pipe[8554]: BCDB71C0DA: to=<grmpfl at example.net>, relay=dovecot, delay=1331, delays=1331/0.01/0/0.03, dsn=4.3.0, status=deferred (temporary failure. Command output: Quota exceeded (mailbox for user is full) )
8. Try deleting maildirsize and a new delivery:
# rm Maildir/maildirsize
# tail -n 3 /var/log/mail.log
Jan 14 17:19:48 carolyn deliver(grmpfl at example.net): msgid=<20090114161502.7F2AA1C104 at carolyn.beispiel.at>: saved mail to INBOX
Jan 14 17:19:48 carolyn postfix/pipe[8553]: 7F2AA1C104: to=<grmpfl at example.net>, relay=dovecot, delay=286, delays=286/0.04/0/0.13, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 14 17:19:48 carolyn postfix/qmgr[3599]: 7F2AA1C104: removed
[0] http://jetmore.org/john/code/#swaks
More information about the dovecot
mailing list