[Dovecot] GETQUOTAROOT (part 2)
Hello,
I'm a recent convert to dovecot from courier-imap and the performance has certainly improved. I'm running the vanilla 1.0.7 version that came with the CentOS 5.2 x86_64 distro.
I've come across a similar problem that was posted by Ralf Hildebrandt earlier this year under the same subject, but that thread just seems to have died off. I'm also using per- user maildirsize files (originally run under courier-imap) but these are not being read/enforced/updated for some users.
After some testing with these users, the problem seems to be related to the size of the maildirsize file itself. A file size greater than 5119 bytes results in no quota for the INBOX of the user, and the file seems to be ignored entirely by dovecot.
I guess the solution to this is to just copy over a fresh (i.e. empty save for the limit line) maildirsize file, but I was wodering if this maildirsize size limit is some innate property of dovecot. Would not others, especially converts from courier-imap that also use maildirsize files, have this experience also?
Thank you.
Patrick
On Sat, 2008-08-30 at 08:45 -0700, Patrick Medina wrote:
After some testing with these users, the problem seems to be related to the size of the maildirsize file itself. A file size greater than 5119 bytes results in no quota for the INBOX of the user, and the file seems to be ignored entirely by dovecot.
After 5120 bytes the maildirsize file is rebuilt by reading through the entire maildir. This is also what Courier did.
So what exactly happens when the maildirsize is rebuilt? You mean all bytes are counted, except from INBOX?
After 5120 bytes the maildirsize file is rebuilt by reading through the entire maildir. This is also what Courier did.
Thank you for the quick reply and clarification. I was not aware of this behavior before.
So what exactly happens when the maildirsize is rebuilt? You mean all bytes are counted, except from INBOX?
Everything is normal (counted) when the file is rebuilt at 5120 bytes.
The problem seems to be when, upon migration to dovecot, the maildirsize file was already over 5120 bytes (5128, even 5148, normally consisting of one file entry line). With this size, dovecot behaves as if there is no maildirsize file present in the user's maildir.
On Sat, 2008-08-30 at 09:15 -0700, Patrick Medina wrote:
So what exactly happens when the maildirsize is rebuilt? You mean all bytes are counted, except from INBOX?
Everything is normal (counted) when the file is rebuilt at 5120 bytes.
The problem seems to be when, upon migration to dovecot, the maildirsize file was already over 5120 bytes (5128, even 5148, normally consisting of one file entry line). With this size, dovecot behaves as if there is no maildirsize file present in the user's maildir.
If there is no maildirsize file present, it's created. So I'm still not sure what's happening with you. Is it not returning the quota at all? How did you configure quota? Did you specify the limits in userdb/dovecot.conf or were you relying on the limits from maildirsize file? I guess if you were relying on limits from maildirsize file there could have been some bugs in old Dovecot versions.
Relevant dovecot configuration:
protocol imap { mail_plugins = quota imap_quota mail_plugin_dir = /usr/lib64/dovecot/imap listen = 127.0.0.1:143 }
plugin { quota = maildir }
Relevant postfix configuration:
mailbox_command = /usr/libexec/dovecot/deliver
I am exclusively using maildirsize files to enforce quotas.
If there is no maildirsize file present, it's created. So I'm still not sure what's happening with you. Is it not returning the quota at all?
If the maildirsize file is > 5119 bytes, no quota at all.
1 getquotaroot INBOX
- QUOTAROOT "INBOX" ""
- QUOTA "" () 1 OK Getquotaroot completed.
new emails do not register in maildirsize, neither do deleted emails (using imap via webmail).
Did some further testing:
- maildirsize was initially = 5119 bytes
- login via imap command line, verified GETQUOTAROOT returns correct quota, then logged out
- sent test email and is delivered by deliver
- maildirsize is updated but now = 5126 bytes (i.e. it is _not_ recreated)
- log in again and GETQUOTAROOT now returns empty
- quota thereafter no longer works
Interestingly, it's a different story if I stay logged on the imap command line:
- maildirsize was initially = 5119 bytes
- login via imap command line, verified GETQUOTAROOT returns correct quota, do not log out
- sent test email and is delivered by deliver
- maildirsize is updated but now = 5126 bytes (i.e. it is _not_ recreated, _yet_)
- from the same imap session, again issue GETQUOTAROOT
- correct quota is returned and maildirsize has been recreated with only limit and updated total usage as contents
Anyway, will try to migrate to the 1.1 version and see if this problem goes away for me. Thank you for your attention.
On Aug 31, 2008, at 8:34 PM, Patrick Medina wrote:
Did some further testing:
- maildirsize was initially = 5119 bytes
- login via imap command line, verified GETQUOTAROOT returns correct quota, then logged out
- sent test email and is delivered by deliver
- maildirsize is updated but now = 5126 bytes (i.e. it is _not_ recreated)
- log in again and GETQUOTAROOT now returns empty
- quota thereafter no longer works
OK, that's clearly a bug. If it's not gone in v1.1 I'll look at it
again. And in any case it would be more reliable if you could have
your userdb return the quota limits, that way Dovecot can correctly
recreate the maildirsize at any time.
Words by Patrick Medina [Sat, Aug 30, 2008 at 08:45:43AM -0700]:
Hello,
I'm a recent convert to dovecot from courier-imap and the performance has certainly improved. I'm running the vanilla 1.0.7 version that came with the CentOS 5.2 x86_64 distro.
I've come across a similar problem that was posted by Ralf Hildebrandt earlier this year under the same subject, but that thread just seems to have died off. I'm also using per- user maildirsize files (originally run under courier-imap) but these are not being read/enforced/updated for some users.
After some testing with these users, the problem seems to be related to the size of the maildirsize file itself. A file size greater than 5119 bytes results in no quota for the INBOX of the user, and the file seems to be ignored entirely by dovecot.
If the maildirsize is >= 5120 bytes the quota is recalculated and a new maildirsize should appear. But there should be a quota, of course. Anyway I never seen that behaviour. Can you upgrade to a recent (1.1.something) dovecot version and see if it happens also?
-- Jose Celestino | http://japc.uncovering.org/files/japc-pgpkey.asc
"One man’s theology is another man’s belly laugh." -- Robert A. Heinlein
participants (3)
-
Jose Celestino
-
Patrick Medina
-
Timo Sirainen