Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 16/02/13 14:50, Timo Sirainen wrote: On Wed, 2013-02-13 at 11:49 +, Rob Redpath wrote: Dovecot's zlib plugin requires that the maildir filenames have ,S=uncompressed size. Otherwise you get those errors. http://dovecot.org/tools/maildir-size-check.sh can be used to fix the filenames. Thanks for this. The problem I'm encountering is that Dovecot renames files, and does so to their size on disk rather than their uncompressed size, undoing any corrective action that's been taken. Yeah. It's a bit difficult to change the automated fixing code to work properly with compressed files without some very ugly kludges. BTW. http://dovecot.org/tools/maildir-size-fix.pl has been updated to work with compressed files also, making maildir-size-check.sh obsolete. I had a quick look myself - it looks like it would be! Obviously I can't leave my production system in a state where mail can't be accessed by some of its users - so what would your advice be to work around this? I think my options are:- - Modify and recompile dovecot so that the affected sub is a no-op and guarantee that filenames will always reflect the uncompressed size of the message through other means OR - Ensure that the sub never gets called. What condition is it that Dovecot encounters that triggers it to rename a file? Thanks for you help with this!
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 19.2.2013, at 11.39, Rob Redpath rob.redp...@heartinternet.co.uk wrote: BTW. http://dovecot.org/tools/maildir-size-fix.pl has been updated to work with compressed files also, making maildir-size-check.sh obsolete. I had a quick look myself - it looks like it would be! Obviously I can't leave my production system in a state where mail can't be accessed by some of its users - so what would your advice be to work around this? I think my options are:- - Modify and recompile dovecot so that the affected sub is a no-op and guarantee that filenames will always reflect the uncompressed size of the message through other means OR - Ensure that the sub never gets called. What condition is it that Dovecot encounters that triggers it to rename a file? Just run the maildir-size-fix.pl to your existing maildirs and you should have no problems in future?
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 19/02/13 09:42, Timo Sirainen wrote: On 19.2.2013, at 11.39, Rob Redpath rob.redp...@heartinternet.co.uk wrote: BTW. http://dovecot.org/tools/maildir-size-fix.pl has been updated to work with compressed files also, making maildir-size-check.sh obsolete. I had a quick look myself - it looks like it would be! Obviously I can't leave my production system in a state where mail can't be accessed by some of its users - so what would your advice be to work around this? I think my options are:- - Modify and recompile dovecot so that the affected sub is a no-op and guarantee that filenames will always reflect the uncompressed size of the message through other means OR - Ensure that the sub never gets called. What condition is it that Dovecot encounters that triggers it to rename a file? Just run the maildir-size-fix.pl to your existing maildirs and you should have no problems in future? Sadly, that doesn't seem to work. In a normal case where I see this issue, running maildir-size-fix.pl (with -a -c -f -r -v options) identifies and renames lots of files, but then accessing the mailbox causes dovecot to rename them back to the incorrect values. One thing I've noticed during testing this is that, in my doveadm fetch output for an affected mailbox, the same UID appears to be processed over and over before Dovecot moves on. In the example I happen to have on screen, this line appears 13 times in the output, each with with a larger value to the right of the doveadm(u...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S to /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S doveadm(u...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/user_example.com_d/.INBOX.eBay/dovecot.index.cache: Broken physical size for mail UID 99
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 19.2.2013, at 16.48, Rob Redpath rob.redp...@heartinternet.co.uk wrote: Just run the maildir-size-fix.pl to your existing maildirs and you should have no problems in future? Sadly, that doesn't seem to work. In a normal case where I see this issue, running maildir-size-fix.pl (with -a -c -f -r -v options) identifies and renames lots of files, but then accessing the mailbox causes dovecot to rename them back to the incorrect values. Then something is wrong. One thing I've noticed during testing this is that, in my doveadm fetch output for an affected mailbox, the same UID appears to be processed over and over before Dovecot moves on. In the example I happen to have on screen, this line appears 13 times in the output, each with with a larger value to the right of the doveadm(u...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S to /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S doveadm(u...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/user_example.com_d/.INBOX.eBay/dovecot.index.cache: Broken physical size for mail UID 99 Have you enabled zlib plugin globally, not just for e.g. IMAP protocol? Show your doveconf -n output.
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 19/02/13 15:41, Timo Sirainen wrote: On 19.2.2013, at 16.48, Rob Redpath rob.redp...@heartinternet.co.uk wrote: Just run the maildir-size-fix.pl to your existing maildirs and you should have no problems in future? Sadly, that doesn't seem to work. In a normal case where I see this issue, running maildir-size-fix.pl (with -a -c -f -r -v options) identifies and renames lots of files, but then accessing the mailbox causes dovecot to rename them back to the incorrect values. Then something is wrong. One thing I've noticed during testing this is that, in my doveadm fetch output for an affected mailbox, the same UID appears to be processed over and over before Dovecot moves on. In the example I happen to have on screen, this line appears 13 times in the output, each with with a larger value to the right of the doveadm(u...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S to /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S doveadm(u...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/user_example.com_d/.INBOX.eBay/dovecot.index.cache: Broken physical size for mail UID 99 Have you enabled zlib plugin globally, not just for e.g. IMAP protocol? Show your doveconf -n output. I believe that the plugin is enabled globally - # 2.1.10: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-279.el6.x86_64 x86_64 Red Hat Enterprise Linux Server release 6.3 (Santiago) auth_mechanisms = plain login cram-md5 digest-md5 apop auth_socket_path = /var/run/dovecot/auth-userdb auth_username_chars = auth_worker_max_count = 8192 default_client_limit = 32771 default_internal_user = mail default_process_limit = 32771 disable_plaintext_auth = no first_valid_uid = 8 last_valid_uid = 8 lda_mailbox_autocreate = yes mail_location = maildir:%h mail_plugins = quota zlib namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox Sent Messages { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = } passdb { args = /var/mail-auth/passwd.dovecot driver = passwd-file } passdb { args = /var/mail-auth/legacy.%l driver = passwd-file } plugin { quota = maildir quota_rule = ?:storage=400M quota_rule2 = Trash:storage=+10% quota_warning = storage=90%% quota-warning 90 %u } service anvil { client_limit = 65545 } service auth { client_limit = 118793 unix_listener auth-userdb { group = mail mode = 0600 user = mail } } service imap-login { process_min_avail = 16 vsz_limit = 64 M } service imap-postlogin { executable = script-login /usr/local/bin/count_imap_login group = mail user = mail } service imap { executable = imap imap-postlogin process_limit = 16384 } service pop3-postlogin { executable = script-login /usr/local/bin/count_pop_login group = mail user = mail } service pop3 { executable = pop3 pop3-postlogin process_limit = 4096 } service quota-warning { executable = script /usr/local/bin/send-mailbox-near-quota-warning unix_listener quota-warning { user = mail } user = mail } ssl_cert = /etc/ssl/certs/redacted.pem ssl_key = /etc/ssl/certs/redacted.pem userdb { args = /var/mail-auth/passwd.dovecot driver = passwd-file } userdb { args = /var/mail-auth/legacy.%l driver = passwd-file } verbose_proctitle = yes protocol imap { imap_capability = +QUOTA SORT SORT=DISPLAY mail_max_userip_connections = 50 mail_plugins = quota zlib imap_quota } protocol pop3 { mail_max_userip_connections = 40 pop3_reuse_xuidl = yes }
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 19.2.2013, at 17.45, Rob Redpath rob.redp...@heartinternet.co.uk wrote: On 19/02/13 15:41, Timo Sirainen wrote: On 19.2.2013, at 16.48, Rob Redpath rob.redp...@heartinternet.co.uk wrote: Just run the maildir-size-fix.pl to your existing maildirs and you should have no problems in future? Sadly, that doesn't seem to work. In a normal case where I see this issue, running maildir-size-fix.pl (with -a -c -f -r -v options) identifies and renames lots of files, but then accessing the mailbox causes dovecot to rename them back to the incorrect values. Then something is wrong. One thing I've noticed during testing this is that, in my doveadm fetch output for an affected mailbox, the same UID appears to be processed over and over before Dovecot moves on. In the example I happen to have on screen, this line appears 13 times in the output, each with with a larger value to the right of the doveadm(u...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S to /var/spool/virtual_mail/user_example.com_d/.INBOX.folder/cur/1308038406.M274176P16579.mail.example.net,S=11919:2,S doveadm(u...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/user_example.com_d/.INBOX.eBay/dovecot.index.cache: Broken physical size for mail UID 99 Have you enabled zlib plugin globally, not just for e.g. IMAP protocol? Show your doveconf -n output. I believe that the plugin is enabled globally - Try with a test user or some mailbox that has only one mail. See if maildir-size-fix.pl really makes the file size correct by checking that the S=size matches zcat file|wc output. Then see if Dovecot breaks it again with e.g.: nc localhost 143 a login user pass b select inbox c fetch 1:* body.peek[]
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On Wed, 2013-02-13 at 11:49 +, Rob Redpath wrote: Dovecot's zlib plugin requires that the maildir filenames have ,S=uncompressed size. Otherwise you get those errors. http://dovecot.org/tools/maildir-size-check.sh can be used to fix the filenames. Thanks for this. The problem I'm encountering is that Dovecot renames files, and does so to their size on disk rather than their uncompressed size, undoing any corrective action that's been taken. Yeah. It's a bit difficult to change the automated fixing code to work properly with compressed files without some very ugly kludges. BTW. http://dovecot.org/tools/maildir-size-fix.pl has been updated to work with compressed files also, making maildir-size-check.sh obsolete.
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 05/02/13 02:06, Timo Sirainen wrote: On Tue, 2013-01-29 at 19:58 +, Rob Redpath wrote: I'm encountering two, probably related, errors in my Dovecot 2.1.10 install. The issue relates to compressed email stored in Maildir format directories. In some cases, a mailbox will become inaccessible, and the following will be logged from a doveadm fetch:- doveadm(i...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache: Broken physical size for mail UID 2777 doveadm(i...@example.com): Error: Cached message size smaller than expected (18996 64624) doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z to /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z Interestingly, the file mentioned in the error ( /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache ) doesn't exist. The uncompressed size of the file is 64624 bytes, the compressed size is 18996. Dovecot's zlib plugin requires that the maildir filenames have ,S=uncompressed size. Otherwise you get those errors. http://dovecot.org/tools/maildir-size-check.sh can be used to fix the filenames. Thanks for this. The problem I'm encountering is that Dovecot renames files, and does so to their size on disk rather than their uncompressed size, undoing any corrective action that's been taken. For example:- [root@mailserver ~]# ls /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ [root@mailserver ~]# zcat /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ | wc 3451530 24587 [root@mailserver ~]# mv /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=24587:2,SZ [root@mailserver ~]# doveadm fetch -u i...@example.com text all /dev/null snip doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=24587:2,SZ to /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /snip
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 05/02/13 02:06, Timo Sirainen wrote: On Tue, 2013-01-29 at 19:58 +, Rob Redpath wrote: I'm encountering two, probably related, errors in my Dovecot 2.1.10 install. The issue relates to compressed email stored in Maildir format directories. In some cases, a mailbox will become inaccessible, and the following will be logged from a doveadm fetch:- doveadm(i...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache: Broken physical size for mail UID 2777 doveadm(i...@example.com): Error: Cached message size smaller than expected (18996 64624) doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z to /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z Interestingly, the file mentioned in the error ( /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache ) doesn't exist. The uncompressed size of the file is 64624 bytes, the compressed size is 18996. Dovecot's zlib plugin requires that the maildir filenames have ,S=uncompressed size. Otherwise you get those errors. http://dovecot.org/tools/maildir-size-check.sh can be used to fix the filenames. Thanks for this. The problem I'm encountering is that Dovecot renames files, and does so to their size on disk rather than their uncompressed size, undoing any corrective action that's been taken. For example:- [root@mailserver ~]# ls /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ [root@mailserver ~]# zcat /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ | wc 3451530 24587 [root@mailserver ~]# mv /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=24587:2,SZ [root@mailserver ~]# doveadm fetch -u i...@example.com text all /dev/null snip doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=24587:2,SZ to /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /snip
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On 05/02/13 02:06, Timo Sirainen wrote: On Tue, 2013-01-29 at 19:58 +, Rob Redpath wrote: I'm encountering two, probably related, errors in my Dovecot 2.1.10 install. The issue relates to compressed email stored in Maildir format directories. In some cases, a mailbox will become inaccessible, and the following will be logged from a doveadm fetch:- doveadm(i...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache: Broken physical size for mail UID 2777 doveadm(i...@example.com): Error: Cached message size smaller than expected (18996 64624) doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z to /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z Interestingly, the file mentioned in the error ( /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache ) doesn't exist. The uncompressed size of the file is 64624 bytes, the compressed size is 18996. Dovecot's zlib plugin requires that the maildir filenames have ,S=uncompressed size. Otherwise you get those errors. http://dovecot.org/tools/maildir-size-check.sh can be used to fix the filenames. Thanks for this. The problem I'm encountering is that Dovecot renames files, and does so to their size on disk rather than their uncompressed size, undoing any corrective action that's been taken. For example:- [root@mailserver ~]# ls /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ [root@mailserver ~]# zcat /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ | wc 3451530 24587 [root@mailserver ~]# mv /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=24587:2,SZ [root@mailserver ~]# doveadm fetch -u i...@example.com text all /dev/null snip doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=24587:2,SZ to /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H12P6490.mailserver.example.net,S=4580:2,SZ /snip
Re: [Dovecot] Broken physical size caching in Dovecot 2.1.10
On Tue, 2013-01-29 at 19:58 +, Rob Redpath wrote: I'm encountering two, probably related, errors in my Dovecot 2.1.10 install. The issue relates to compressed email stored in Maildir format directories. In some cases, a mailbox will become inaccessible, and the following will be logged from a doveadm fetch:- doveadm(i...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache: Broken physical size for mail UID 2777 doveadm(i...@example.com): Error: Cached message size smaller than expected (18996 64624) doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z to /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z Interestingly, the file mentioned in the error ( /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache ) doesn't exist. The uncompressed size of the file is 64624 bytes, the compressed size is 18996. Dovecot's zlib plugin requires that the maildir filenames have ,S=uncompressed size. Otherwise you get those errors. http://dovecot.org/tools/maildir-size-check.sh can be used to fix the filenames.
[Dovecot] Broken physical size caching in Dovecot 2.1.10
Hi, I'm encountering two, probably related, errors in my Dovecot 2.1.10 install. The issue relates to compressed email stored in Maildir format directories. In some cases, a mailbox will become inaccessible, and the following will be logged from a doveadm fetch:- doveadm(i...@example.com): Error: Corrupted index cache file /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache: Broken physical size for mail UID 2777 doveadm(i...@example.com): Error: Cached message size smaller than expected (18996 64624) doveadm(i...@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z to /var/spool/virtual_mail/info_example.com_d/cur/1277451630.H877760P14612.mailserver.example.com,S=18996:2,Z Interestingly, the file mentioned in the error ( /var/spool/virtual_mail/info_example.com_d/dovecot.index.cache ) doesn't exist. The uncompressed size of the file is 64624 bytes, the compressed size is 18996. My attempts to debug the issue myself didn't get very far - the function that appears to return the wrong value is in /src/lib-storage/index/maildir/maildir-mail.c in the 2.1.13 source; it's do_fix_size() and appears to not consider whether a file is compressed or not when reporting it's size for S= value purposes. Can anyone help? I'm happy to provide parts of dovecot -n output if required, but I'd rather not post configuration in a public forum if it's not required. -- Rob Redpath Systems Administrator Heart Internet Ltd E: rob.redp...@heartinternet.co.uk DDI: 0115 845 6643 www.heartinternet.co.ukhttp://www.heartinternet.co.uk ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. Heart Internet Ltd accepts no responsibility for information, errors or omissions in this email. **