Symptoms
When Dovecot is utilized as the IMAP/POP server, an empty inbox is displayed in Horde/Roundcube webmail and email clients like Thunderbird or Outlook.
- The notification icon displaying the number of emails in the Inbox is visible in both webmail and external mail clients, but the actual emails within the Inbox are not visible.
The following error is found in
/var/log/maillog:dovecot Error: service=imap, [email protected], ip=[127.0.0.1]. Mailbox INBOX: UID=33261: read(/var/qmail/mailnames/example.com/username/Maildir/cur/1520269963.M402118P28216V0000000000000802I00000000001840FA.CL0016UC-SG1.EXAMPLE.COM,S=1448:2,S) failed: Cached message size larger than expected (1448 > 1188, box=INBOX, UID=33261)
dovecot: Error: service=imap, [email protected], ip=[127.0.0.1]. Corrupted record in index cache file /var/qmail/mailnames/example.com/username/Maildir/dovecot.index.cache: UID 33261: Broken physical size in mailbox INBOX
The following error is shown on attempt to enter Roundcube > Sent folder:
UID SORT: external error occurred. Refer to server log for more information. [2020-01-22 20:05:18] (0.218 + 0.000 + 0.217 secs).
IMAP error reported by server
Some emails may be shown with "Invalid Address" for Sender and "[No Subject]" for Subject:
Cause
Mailbox cache file mentioned in the error is broken or corrupted.
Resolution
- Connect to the server via SSH.
Plain mail
Move Dovecot cache files from the error message to re-create cache:
# mv /var/qmail/mailnames/example.com/username/Maildir/dovecot* /tmp/
# mv /var/qmail/mailnames/example.com/username/Maildir/cur/1520269963.M402118P28216V0000000000000802I00000000001840FA.CL0016UC-SG1.EXAMPLE.COM,S=1448:2,S /tmp/Cache will be re-created automatically.
Restart
dovecotservice:# service dovecot restart
GZipped Mail Resolution
Edit file
/etc/dovecot/conf.d/99-zlib-support.confand add the following content:mail_plugins = $mail_plugins zlib
protocol imap {
mail_plugins = $mail_plugins imap_quota zlib
}Restart
dovecotservice:# service dovecot restart