Hi all,

I have a issue with a user in the INBOX directory. Dovecot log some errors :

06/05/2024 22:05:21 info imap(eaubert@kicou.org)<6008><wfrJls4XidrAqAD+>: Disconnected: FETCH failed: Mailbox INBOX: UID=84119: read(/var/vmail/kicou.org/eaubert/Maildir/cur/1643120769.M529384P29977.31eb8cd24857,S=8843,W=9008:2,S) failed: Cached message size larger than expected (8843 > 0, box=INBOX, UID=84119) in=311 out=1184 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
06/05/2024 22:05:21 err imap(eaubert@kicou.org)<6008><wfrJls4XidrAqAD+>: Error: Mailbox INBOX: UID=84119: read(/var/vmail/kicou.org/eaubert/Maildir/cur/1643120769.M529384P29977.31eb8cd24857,S=8843,W=9008:2,S) failed: Cached message size larger than expected (8843 > 0, box=INBOX, UID=84119)
06/05/2024 22:05:21 err imap(eaubert@kicou.org)<6008><wfrJls4XidrAqAD+>: Error: Mailbox INBOX: Deleting corrupted cache record uid=84119: UID 84119: Broken physical size in mailbox INBOX: read(/var/vmail/kicou.org/eaubert/Maildir/cur/1643120769.M529384P29977.31eb8cd24857,S=8843,W=9008:2,S) failed: Cached message size larger than expected (8843 > 0, box=INBOX, UID=84119)
06/05/2024 22:05:21 err imap(eaubert@kicou.org)<6008><wfrJls4XidrAqAD+>: Error: Mailbox INBOX: UID=84119: read(/var/vmail/kicou.org/eaubert/Maildir/cur/1643120769.M529384P29977.31eb8cd24857,S=8843,W=9008:2,S) failed: Cached message size larger than expected (8843 > 0, box=INBOX, UID=84119) (read reason=mail stream)

Seems, some mail files are corrupted or some cached are corrupted.
How can I force dovecot to rebuild the cache (if needed ?).

I try the solution of @lnxgeek in the message : mailcow community Icon Cached message size larger than expected

But, after moving more than 10 messages, still have a issue in another message.

Showing message of the INBOX in SOGo working well.
Showing message of the INBOX in IMAP (with Thunderbird) only work the fisrt time, without be able to refresh after.

Hope someone can help me to fix this issue.

Regars,

    • Best Answerset by kicou

    Hi,

    Solved by :

    Make a specific dovecot conf with this tutorial :
    https://docs.mailcow.email/manual-guides/Dovecot/u_e-dovecot-extra_conf/

    Add this specific config :
    maildir_broken_filename_sizes=yes

    Restart dovecot.
    Run thunderbird sync again. It will show a list of corrupted mail without correct date, etc, etc.
    I could remove in one step all the corrupted mail (hundreds).

    At the end, remove the specific dovecot config, restart dovecot.

    Works like a charm since now !

    Kicou

After I deleted the mentioned files the problem went away for me.

You could try the same as a first step.

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

7 days later

Hi @lnxgeek

Already try this, but after moving twenty mail, still the error on an another file.

The mail are correctly show in the SOGo web interface.
Does it could be a compression error ?

Does it be possible to remove all the dovecot cache somewhere ?

BR

7 days later

Hi,

Solved by :

Make a specific dovecot conf with this tutorial :
docs.mailcow.email Icon Customize/Expand dovecot.conf - mailcow: dockerized documentation

Add this specific config :
maildir_broken_filename_sizes=yes

Restart dovecot.
Run thunderbird sync again. It will show a list of corrupted mail without correct date, etc, etc.
I could remove in one step all the corrupted mail (hundreds).

At the end, remove the specific dovecot config, restart dovecot.

Works like a charm since now !

Kicou

No one is typing