A recent & common issue faced with dovecot service in cPanel based server’s is the corruption of dovecot.index files for the email accounts. When the index file is broken, the respective user facing this issue will not be able to login to his webmail and will throw up a ‘server error’. The basic idea behind Dovecot’s index files is that it makes reading the mailboxes a lot faster.
Checking the logs to confirm its the issue with dovecot.index file :
# tailf /var/log/maillog
###################################
host dovecot: imap(zzzz@yyyy.com): Error: Transaction log file /pathto/dovecot.index.log seq 302: log_file_tail_offset update shrank it (988 vs 1184 sync_offset=972)
host dovecot: imap(zzzz@yyyy.com): Error: broken sync positions in index file /pathto/dovecot.index
host dovecot: imap(zzzz@yyyy.com) Error: Fixed index file /pathto/dovecot.index log_file_tail_offset 1184 -> 988
###################################
The solution to fix this issue is to delete the dovecot.index file for the respective user and for the respective folder.
# rm -rf /path-to-the-/dovecot.index
If you find that this file is broken for the folder ‘Trash’, then do delete the index file which is found in Trash. This happens to be a long term bug with dovecot and deleting the index file and recreating ( automatically done by dovecot) is the only solution at this juncture.