Score:0

Dovecot fails to fetch messages due to cache size issues

sr flag

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.

anx avatar
fr flag
anx
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.
lopass avatar
sr flag
@anx good to know, I will avoid it
Score:1
sr flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.