0

I migrated maildir users from an old courier imap install to dovecot on docker alpine:latest. Initially everything seemed great, however, a problem seems to have crept in. Some messages will fail to fetch due to cache size differences, the logs end up looking like this:

  1. Error read(/mailmessage1) Cached message size smaller than expected
  2. Error Broken physical size in mailbox
  3. Error Deleting corrupted cache record
  4. Error read(/mailmessage1) Cached message size smaller than expected

Not very helpful. Based on this entry here: https://xpufx.com/posts/dovecot_doveadm_failed_cache_message_size_error/

I think I have a mismatch between two service configs, but I am not seeing anything obvious, should I just make zlib a global config?

None of the messages in the maildir are compressed. Not on much on google about this other than some complaints about mbox.

lopass
  • 11
  • 3
  • If you were not using compressed files in maildir, do not start now. That feature is.. dangerous at best. Mentions of it popping up when you google for basically any dovecot error message should be sufficient proof that one really wanting compression should use other, entirely transparent to dovecot, mechanisms. – anx Jul 28 '23 at 09:12
  • @anx good to know, I will avoid it – lopass Jul 29 '23 at 01:43

1 Answers1

1

Been digging into this off and on.

Maildir filenames have the size as part of the filename. According to this comment:

v1.1 by Timo Sirainen, public domain

some maildir filenames created by .. courier? maildrop? .. has file sizes

that don't match the file's real size. this script finds such files and

renames them. if they're found from dovecot-uidlist, they're also renamed

within there, so their IMAP UID doesn't change either. the POP3 UIDL

is also optionally preserved then.

From this script: https://github.com/dovecot/tools/blob/main/maildir-size-fix.pl

The size in the filenames can be wrong. I verified a few were incorrect, and am looking at using maildir_broken_filename_sizes=yes to fix this for now. I will edit this answer if I run into any further difficulties with this solution.

lopass
  • 11
  • 3