Pigeonhole/sieve possibly corrupting mails

Timo Sirainen tss at iki.fi
Thu Oct 20 15:50:25 UTC 2016


On 15 Oct 2016, at 21:59, Ladislav Laska <laska at kam.mff.cuni.cz> wrote:
> 
> Hi!
> 
> I'm here again with a problem. I'm using dovecot as an IMAP server and
> LDA, filtering mail via sieve. However, few times a day I get the
> following error on server and my client (mutt) gets disconnected.
> 
> Oct 15 20:20:29 ibex dovecot: imap(krakonos): Error: Corrupted index cache file /home/krakonos/.mbox/.imap/INBOX/dovecot.index.cache: Broken physical s ize for mail UID 149418 in mailbox INBOX: read(/home/krakonos/.mbox/inbox) failed: Cached message size smaller than expected (3793 < 8065, box=INBOX, UID=149418, cached
..
> Oct 15 20:15:12 ibex dovecot: lda(krakonos): Error: Next message
> unexpectedly corrupted in mbox file /home/krakonos/.mbox/inbox at
> 546862809

Somehow Dovecot thinks that the mbox file changed under it..

> The filesystem is ext4, and there are no errors in syslog or problems
> with any other services.
> 
> I also don't access the mbox locally, and only dovecot manipulates the
> mbox (via imap and mailbox_command = /usr/libexec/dovecot/deliver)

So it shouldn't have broken.

> The postfix version is 2.2.25. I'm attaching dovecot -n and the
> offending message (after it's been corrected). I'd rather not publish my
> sieve file, but will send it privately.
> 
> The offending message also contains other message I received at
> approximately the same time. 
> 
> Any hint's on what could be wrong?

These mbox corruptions are usually pretty difficult to reproduce (= impossible to fix without ability to reproduce). You could try if you can (reliably) reproduce it in some way, e.g.:

1. Create a test folder: doveadm mailbox create -u krakonos testbox
2. Use some combination of:
 * Save mail(s) to test folder: cat some-mails | doveadm save -u krakonos testbox
 * Try to read mails from test folder: doveadm fetch -u krakonos text mailbox testbox > /dev/null

The fetch should print similar errors to stderr in some way. I attempted to reproduce this way with your msg-error.mbox, but it worked ok.



More information about the dovecot mailing list