Inconsistencies in mailboxes occur rarely, but they occur. There are three main reasons for an inconsistency:
• An email file deleted on the server (by an admin)
• Email files copied in the mailbox dir (back-up of emails deleted by the user)
• Corrupted files (disk errors, broken communication)
Emails are stored in files named like 8242. and there are two files that keep track of emails: cyrus.header and cyrus.index. If an email is missing on the server but it appears in these files, your user won’t be able to get email headers from the server. Outlook will report a 0x800CCC90 error while receiving mails, and Squirrelmail will say ERROR: Could not complete request. Unknown response from IMAP server: 1.* OK Message 8242 no longer exists.
To fix this problem you should use the tool called reconstruct. It searches for email files and updates the header and index file. Depending on your distribution of Linux, reconstruct can be found in different directories. In my case it was in /usr/lib/cyrus-imapd. reconstruct must be ran as the user cyrus, otherwise it will mess up dir permissions. Supposing you want to repair the mailbox of the user dummy, here are the commands you should use:
su cyrus
/usr/lib/cyrus-imapd/reconstruct -r user.dummy