[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(info@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(info@example.com): Error: Cached message size smaller than expected (18996 < 64624) doveadm(info@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.redpath@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.
On Tue, 2013-01-29 at 19:58 +0000, 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(info@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(info@example.com): Error: Cached message size smaller than expected (18996 < 64624) doveadm(info@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.
On 05/02/13 02:06, Timo Sirainen wrote:
On Tue, 2013-01-29 at 19:58 +0000, 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(info@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(info@example.com): Error: Cached message size smaller than expected (18996 < 64624) doveadm(info@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.H188882P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ [root@mailserver ~]# zcat /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ | wc 345 1530 24587 [root@mailserver ~]# mv /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=24587:2,SZ
[root@mailserver ~]# doveadm fetch -u "info@example.com" text all > /dev/null <snip> doveadm(info@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=24587:2,SZ to /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ </snip>
On Wed, 2013-02-13 at 11:49 +0000, 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.
On 16/02/13 14:50, Timo Sirainen 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
On Wed, 2013-02-13 at 11:49 +0000, Rob Redpath wrote: 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:- the message through other means
- Modify and recompile dovecot so that the affected sub is a no-op and guarantee that filenames will always reflect the uncompressed size of
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!
On 19.2.2013, at 11.39, Rob Redpath rob.redpath@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?
On 19/02/13 09:42, Timo Sirainen wrote:
On 19.2.2013, at 11.39, Rob Redpath rob.redpath@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(user@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(user@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
On 19.2.2013, at 16.48, Rob Redpath rob.redpath@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(user@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(user@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.
On 19/02/13 15:41, Timo Sirainen wrote:
On 19.2.2013, at 16.48, Rob Redpath rob.redpath@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(user@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(user@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 =
On 19.2.2013, at 17.45, Rob Redpath rob.redpath@heartinternet.co.uk wrote:
On 19/02/13 15:41, Timo Sirainen wrote:
On 19.2.2013, at 16.48, Rob Redpath rob.redpath@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(user@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(user@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[]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 16 Feb 2013, Timo Sirainen 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.
This script seems to be broken for v1.x uidlist files, because those do not have a ":" preceeding the filename always. Therefore the condition never matches. Attached patch corrects that. - --- maildir-size-fix.pl_orig 2013-03-06 09:20:53.000000000 +0100 +++ maildir-size-fix.pl_origExtraFix 2013-03-06 11:26:24.000000000 +0100 @@ -130,3 +130,3 @@ chomp $_; - - if (/^(\d+) ([^:]*)?:(.*)$/) { + if (/^(\d+) ([^:]*:)?(.*)$/) { my ($uid, $extra, $fname) = ($1, $2, $3); @@ -135,12 +135,15 @@ $base_fname =~ s/:.*$//; - - my $new_fname = $base_renames{$base_fname}; - - if (!$new_fname || !$preserve_pop3_uidl || $extra =~ /\bP/) { - - $fname = $new_fname if ($new_fname); - - print $fout "$uid $extra:$fname\n"; - - } else { - - $fname =~ s/:.*$//; - - print $fout "$uid P$fname $extra:$new_fname\n"; + if(exists $base_renames{$base_fname}) { + # filename changes + $extra = ":" unless defined $extra; # v2 uidlist has : always + print $fout $uid; + if ($preserve_pop3_uidl && $extra !~ /\bP/) { + print $fout " P", $base_fname; + } + print $fout " ", $extra, $base_renames{$base_fname}, "\n"; + } else { # no new name, keep line unchanged + print $fout $_, "\n"; } } else { - - print $fout "$_\n"; + print $fout $_, "\n"; } - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEVAwUBUTceqF3r2wJMiz2NAQLEvgf9GcSFXRy3sdu6zTsBpD7csgtgUGbrbDxD z2zWtAsyGL61giNGEemaP+l4aZazS3dR8eby3uCrttduoAJ6ZEKm/H3pzHF9cTDd +LLZbw2Kz//ckdAWTaLEt3QoWzKgjMkyYrgVpHyP5OGsz8ZcKtpQ58/E2c3rQXnf WFX2f0P9edtM8ShVwbhYRozPnCXp54E/YW/ro37esJgAPTySY/pqyfrTEt38GhIH z3L30nIm1Cs83X4hRezMz6xQAWghnbJy4MttAZy6NSur5riHp5oZVWDR3fkAD89t +gh5q3+d6fBbTsLmi1I4E/r3qrtqcFHNmmdrP82YXtTL7SiCAMdlHw== =K0Vm -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 6 Mar 2013, Steffen Kaiser wrote:
Sorry for the noise, you cannot upgrade V1 uidlist files to V3 ones on the fly with this script, hence, this match:
chomp $_;
- if (/^(\d+) ([^:]*)?:(.*)$/) {
- if (/^(\d+) ([^:]*:)?(.*)$/) { my ($uid, $extra, $fname) = ($1, $2, $3);
breaks IMAP UIDs afterwards, so the patch for maildir-size-fix.pl is nonsense. I wonder why it worked in first tests ... .
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUTd2Cl3r2wJMiz2NAQI69Qf+MpXpakEW02Yo2vAq+Z/aScpWTlurZBAD heBYWemoCeQ5liZYhPC/JbVlhhg6EH39WxvUtN8tMl3Cr7YZHIbZsguij3jR/+al +mYQ1BFpkSX0TUP8xTda82J2ShKEsEDMQLlaayXRZjod87LV6UcKlwRG4Gqr7Eho l382HgHb6XOiYe5bVyVXiwAvolHm1C9OmV50/cgLtrkWC+fKXbU0iP92HbLIobZI 2qkuL3yzLDdyGRJCFJhIlaGOyg/KS9hSZrckMX/giEVQlr2RYqpzc7cT0R38A6Bp QvbV8Lw4VuESLtRO+NtZQ+bV4mhuiwLKVNpb4XVp33ohKcSUBT5xXA== =y99O -----END PGP SIGNATURE-----
On 05/02/13 02:06, Timo Sirainen wrote:
On Tue, 2013-01-29 at 19:58 +0000, 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(info@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(info@example.com): Error: Cached message size smaller than expected (18996 < 64624) doveadm(info@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.H188882P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ
[root@mailserver ~]# zcat /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ | wc 345 1530 24587 [root@mailserver ~]# mv /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=24587:2,SZ
[root@mailserver ~]# doveadm fetch -u "info@example.com" text all > /dev/null <snip> doveadm(info@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=24587:2,SZ to /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ </snip>
On 05/02/13 02:06, Timo Sirainen wrote:
On Tue, 2013-01-29 at 19:58 +0000, 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(info@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(info@example.com): Error: Cached message size smaller than expected (18996 < 64624) doveadm(info@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.H188882P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ
[root@mailserver ~]# zcat /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ | wc 345 1530 24587 [root@mailserver ~]# mv /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=24587:2,SZ
[root@mailserver ~]# doveadm fetch -u "info@example.com" text all > /dev/null <snip> doveadm(info@example.com): Error: Maildir filename has wrong S value, renamed the file from /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=24587:2,SZ to /var/spool/virtual_mail/info_example.com_d/cur/1287153356.H188882P6490.mailserver.example.net,S=4580:2,SZ </snip>
participants (3)
-
Rob Redpath
-
Steffen Kaiser
-
Timo Sirainen