I have a RedHat 8 server running dovecot and postfix. Postfix is delivering messages into my maildir folders and the dovecot is configured to make these available to users via IMAPS. The configuration mostly seems to work, but after running for a while my application starts having errors logging into the server.
When trying to login via IMAPS I will receive the message:
NDC2 N0 [SERVERBUG] Internal error occurred. Refer to server log for more information.
When I look at the dovecot logs I will see error messages like:
Error: Mailbox INBOX: mmap failed: Permission denied (euid=xxx(user) egid=xxx(vmail) UNIX perms appear ok (ACL/MAC wrong?))
Error: Mailbox INBOX: mmap(/my/maildir/path/dovecot.index.cache) failed: Permission denied (euid=xxx(user) egid=xxx(vmail) UNIX perms appear ok (ACL/MAC wrong?))
Error: Mailbox INBOX: Index (in-memory index): in-memory index: Lost log for seq=1 offset=0: Failed to map file seq=2 offset=40..18446744073709551615 (ret=0): Beginning of the log isn't available (initial_mapped=0) - fscking (reopen_reason: Index not open)
Warning: fscking index file (in-memory index)
Error: Mailbox INBOX: Failed to map transaction log /my/maildir/path/dovecot.index.log at sync_offset=40 after locking: Beginning of the log isn't available
From what I can tell the permissions on the directories are fine. This is particularly confusing since it seems to work fine, then randomly start giving the error after a while. Deleting the index files out of each inbox lets it start working again, but obviously that is a workaround and not a real solution.