[Dovecot] 2.1: Error: Maildir filename has wrong S value, renamed the file from

Peer Heinlein p.heinlein at heinlein-support.de
Wed Mar 27 00:15:54 EET 2013

Am 25.03.2013 15:38, schrieb Timo Sirainen:


>> The same problem was reported by Ralf Hildebrandt one year ago. The bug
>> should be fixed with revision 3599790da3d7 but it seems to be there
>> again.
> The Dovecot bug was fixed, but the real reason for this is that the S=values are wrong in your maildir. You can either run the fixing script or set maildir_broken_filename_sizes=yes.

Looks like this (or a related) bug still exist.

If you have a Maildir-Storage with gzip compression enabled,
everything's working fine if the user receives mail by LMTP. The mail is
saved in his Maildir-Storage, having the right (uncompressed) size in
the filename.

vmail vmail 1.9K Mar 26 22:17


If the dovecot.index is broken, corrupt or deleted, Dovecot isn't able
to rebuild his index-files.

In Step ONE dovecot creates his index-files, but looks like Dovecot's
using the (smaller) FILEsize instead of the (larger) real size.

In Step TWO Dovecot's realizing that the cached size and the stored file
size in the filename doesn't fit together. But Dovecot doesn't fix his
index file; instead Dovecot's renaming the Maildir-Files, storing the
(small) file size in the filename.

Mar 26 22:39:17 mailserver2 dovecot: imap(testuser): Error: Cached
message size smaller than expe
cted (1467 < 3780)

Error: Maildir filename has wrong S value, r
enamed the file from
ailserver2,S=3780,W=3860:2, to


*) Create a Maildir-Store with zip enabled
*) Deliver Mails into it. Everything's working fine, the filenames are right
*) Delete dovecot.index*
*) STEP ONE: Dovecot's complaining about broken index-files
*) STEP TWO: Dovecot's renaming the files

I haven't seen any way to find to workaround or repair this broken
Maildir-Storage. Even if I rename all files and set sizes in the
filenames, Dovecot's complaining about the mismatch in his cache and
starts his (broken) repair action.

If we're right, this could be grow to a real problem. Every Server with
zipped Maildirs can be completly ruined just by deleting his


Heinlein Support GmbH
Schwedter Str. 8/9b, 10119 Berlin


Tel: 030 / 405051-42
Fax: 030 / 405051-19

Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht
Geschäftsführer: Peer Heinlein -- Sitz: Berlin

More information about the dovecot mailing list