Symptoms
When logging in to webmail or a mail client, the email list does not show up. Instead, one of the following error messages appears:
Server Error: STATUS: Internal error occurred. Refer to server log for more information.
And the following error messages appears in /var/log/maillog
:
dovecot: imap(user@domain.tld)<28033>: Error: Mailbox INBOX: Index is read-only, can't write-lock /home/username/mail/domain.tld/user/dovecot.index.log
Description
This issue is caused because of incorrect file permissions and ownership.
For example the following:
# ls -lah /home/username/mail/domain.tld/user/dovecot.index.log
-r--r--r-- 1 username username 944 May 5 14:32 /home/username/mail/domain.tld/user/dovecot.index.log
While it should be the following:
# ls -lah /home/username/mail/domain.tld/user/dovecot.index.log
-rw-r----- 1 username username 944 May 5 14:32 /home/username/mail/domain.tld/user/dovecot.index.log
Workaround
You can solve this issue by setting the correct permissions: How do I change permissions on a file or folder?
If all of your domains and email accounts are affected, it might be more efficient to restore the files from a backup: chown or chmod was recursively ran on the wrong directory, is there a way to fix this?