Fixing folder list index (dovecot.list.index)
Dovecot is supposed to fix dovecot.list.index* files automatically. If for whatever reason there is some error that Dovecot can't fix automatically, it's possible to rebuild the indexes from scratch. This should be possible without losing the folder names, because the latest folder names are stored in the per-folder indexes as well.
WARNING
This operation shouldn't lose any folder names because of the 1. step below, but for extra safety get a copy of the dovecot.list.index* files so no matter what happens, the folder names are still possible to recover later on.
- Access the user's all folders to make sure the folder names exist in the folder indexes:sh
doveadm fetch -u user@domain uid 1 > /dev/null - Take a copy of folder indexes:sh
cp dovecot.list.index* /some/backup/ - Open IMAP session for user to make sure it's not removed from metacache:sh
doveadm exec imap -u user@domain - While IMAP session is open, delete indexes:sh
rm dovecot.list.index* - sh
doveadm force-resync -u user@domain '*' - Make sure the folders are properly shown without errors and without having lost any folders:sh
doveadm mailbox list -u user@domain