[Dovecot] Catch22: user needs space to fix out of space condition
A mail user reported that he filled up his INBOX (despite reminders he was approaching his filesystem quota), and furthermore, he could not fix the situation because he couldn't expunge message he marked for deletion.
The dovecot logs revealed the cause
dovecot: imap(user): Error: open(/var/mail/user.lock) failed:
Disc quota exceeded
This created an impasse where a user cannot free space because he needs to create a lock file that cannot be created because he needs free space. Is there any way out of this without administrator intervention?
Joseph Tam jtam.home@gmail.com
Don't use dotlock files.
Method that generally works nice also is to start rejecting email for
the user when they are at 99% capacity, so you leave just alittle room
for that kind of thing left.
Quoting Joseph Tam jtam.home@gmail.com:
A mail user reported that he filled up his INBOX (despite reminders he was approaching his filesystem quota), and furthermore, he could not fix the situation because he couldn't expunge message he marked for deletion.
The dovecot logs revealed the cause
dovecot: imap(user): Error: open(/var/mail/user.lock) failed: Disc quota exceeded
This created an impasse where a user cannot free space because he needs to create a lock file that cannot be created because he needs free space. Is there any way out of this without administrator intervention?
Joseph Tam jtam.home@gmail.com
On Aug 24, 2011, at 5:52 PM, Joseph Tam wrote:
A mail user reported that he filled up his INBOX (despite reminders he was approaching his filesystem quota), and furthermore, he could not fix the situation because he couldn't expunge message he marked for deletion.
The dovecot logs revealed the cause
dovecot: imap(user): Error: open(/var/mail/user.lock) failed: Disc quota exceeded
This created an impasse where a user cannot free space because he needs to create a lock file that cannot be created because he needs free space. Is there any way out of this without administrator intervention?
In your mail_location you can specify a different control and index directory as a place where the user has no quotas. I'm not quite sure which it is (control or index) that says where the dotlock file goes but it should be one of them. Check out the mail_location page in the wiki for more info. This introduces more filesystem complexity (you need one tree for message files and another for mail control/index files) but it does mean that people can log in when they hit their quota and the storage space consumed by their dovecot indexes won't count against them, which I personally think is more fair than letting those things consume quota.
Also, as someone who was using dotlocks for a long time until I could make fcntl locks work over NFS to our Netapp filers, I would strongly recommend trying to move away from dotlocks if you can. We were seeing poor performance and some cache corruption (mail, indexes, control all on NFS with multiple hosts possibly accessing the same user's files) with dotlocks that went away when we switched to native locks.
Joseph Tam jtam.home@gmail.com
David Warden
On 25.8.2011, at 5.12, David Warden wrote:
In your mail_location you can specify a different control and index directory as a place where the user has no quotas. I'm not quite sure which it is (control or index) that says where the dotlock file goes but it should be one of them.
Nope, dotlocks go to exactly where the mbox file is, never elsewhere (otherwise using Dovecot with non-Dovecot software could cause corruption). fcntl locks is the only solution.
On 08/25/2011 07:38 AM, Timo Sirainen wrote:
On 25.8.2011, at 5.12, David Warden wrote:
In your mail_location you can specify a different control and index directory as a place where the user has no quotas. I'm not quite sure which it is (control or index) that says where the dotlock file goes but it should be one of them.
Nope, dotlocks go to exactly where the mbox file is, never elsewhere (otherwise using Dovecot with non-Dovecot software could cause corruption). fcntl locks is the only solution.
Quota rule (conf.d/90-quota.conf)?
plugin { # 10 GByte in kbytes quota_rule = *:storage=10485760
# 1 GByte in kbytes quota_rule2 = Trash:storage=+1048576 }
So you have a quota of 10GB on the mailbox, but the Trash has an additional space of 1GB for the abilioty to delete mails.
Regards Karsten
participants (5)
-
David Warden
-
Joseph Tam
-
Karsten Becker
-
Patrick Domack
-
Timo Sirainen