Siraj 'Sid' Rakhada
2009-Sep-09 14:07 UTC
[Dovecot] Odd/Incorrect Quota Reporting on Dovecot 1.2.4 & FreeBSD4
Hi, Am seeing an odd problem on an old FreeBSD 4.11 box that I'm trying to get courier off, and dovecot on. At the same time, I'm trying to put some fairly simple quota support on, but getting very odd results. I think it might be better described with the log below, but, the gist of it is this: I have set a 1GB quota, and I was getting intermittent reports on the quota usage - sometimes at the correct usage (300MB or so), and then at some crazy amount over the quota usage. I can get it to be consistently incorrect though, as displayed with the below log. The maildirsize is correct, and matches closely to 'du' output, it's simply coming through incorrect on IMAP. It also only seems to happen if the maildirsize is not created before the first 'getquota[root]' command occurs. I think it's something to do with dovecot + FreeBSD (at least, this version)! I've done a quick test on a Debian box, and I don't have the same problem. Anyone else have any ideas what could be going wrong on this FreeBSD box? Is it worth me giving the dovecot -n output at this stage? It happens on different mailboxes too, this is just a sample. Thanks! ----- information & log follow # /usr/local/dovecot/sbin/dovecot --version 1.2.4 # uname -a FreeBSD server1.domain 4.11-RELEASE-p13 FreeBSD 4.11-RELEASE-p13 #5: Wed Oct 12 18:02:46 BST 2005 root at server1.domain:/usr/obj/build/src/sys/FBSD410RELENG i386 # cat maildirsize 1073741824S 304806180 16002 Attempt 1: . OK Capability completed. a login sid at domain test a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH QUOTA] Logged in a getquotaroot inbox * QUOTAROOT "inbox" "User Quota" * QUOTA "User Quota" (STORAGE 117738174 1048576) a OK Getquotaroot completed. a logout * BYE Logging out a OK Logout completed. closed Attempt 2: (on server do 'rm maildirsize') . OK Capability completed. a login sid at domain test a OK [snip] Logged in a getquotaroot inbox * QUOTAROOT "inbox" "User Quota" * QUOTA "User Quota" (STORAGE 117738174 1048576) a OK Getquotaroot completed. (on server, do 'rm maildirsize' again, while still connected, the first 'getquotaroot' is incorrect, as it seems dovecot regenerates the maildirsize file on login, hence the 'rm') a getquotaroot inbox * QUOTAROOT "inbox" "User Quota" * QUOTA "User Quota" (STORAGE 297662 1048576) a OK Getquotaroot completed. a getquotaroot inbox * QUOTAROOT "inbox" "User Quota"
Siraj 'Sid' Rakhada
2009-Sep-09 14:09 UTC
[Dovecot] Odd/Incorrect Quota Reporting on Dovecot 1.2.4 & FreeBSD4
Ack! The bottom of my log was truncated - but not by much, here is all that was skipped: (on server, do 'rm maildirsize' again, while still connected, the first 'getquotaroot' is incorrect, as it seems dovecot regenerates the maildirsize file on login, hence the 'rm') a getquotaroot inbox * QUOTAROOT "inbox" "User Quota" * QUOTA "User Quota" (STORAGE 297662 1048576) a OK Getquotaroot completed. a getquotaroot inbox * QUOTAROOT "inbox" "User Quota" * QUOTA "User Quota" (STORAGE 297662 1048576) a OK Getquotaroot completed. a logout * BYE Logging out a OK Logout completed. closed If reconnecting, the same error occurs as Attempt 1 above.
Timo Sirainen
2009-Sep-09 21:06 UTC
[Dovecot] Odd/Incorrect Quota Reporting on Dovecot 1.2.4 & FreeBSD4
On Wed, 2009-09-09 at 15:07 +0100, Siraj 'Sid' Rakhada wrote:> Am seeing an odd problem on an old FreeBSD 4.11 box that I'm trying to > get courier off, and dovecot on. At the same time, I'm trying to put > some fairly simple quota support on, but getting very odd results.My guess is that this code doesn't work correctly in src/plugins/quota/quota-maildir.c: if (sscanf(*lines, "%lld %d", &bytes_diff, &count_diff) != 2) return -1; You could try if the attached patch fixes it for you. -------------- next part -------------- A non-text attachment was scrubbed... Name: diff Type: text/x-patch Size: 815 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20090909/d0220341/attachment-0004.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090909/d0220341/attachment-0005.bin>