0

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.

Michael
  • 153
  • 1
  • 1
  • 6
  • Any good reason to have Postfix write to maildir at all? Postfix could instead just hand over messages via LMTP and have Dovecot deliver, with delivery happening with all the correct permissions, folder structure only configured in one place, indexes updated right away and idling IMAP clients learning of new messages with low latency. – anx Aug 23 '22 at 17:04
  • Since the error message explicitly asks for ACL and MAC, did you use getfacl to check on the former, and review selinux/apparmor/.. status to check on the latter? – anx Aug 25 '22 at 17:19
  • @anx I did fine that it was a messing SELinux permission. – Michael Aug 26 '22 at 18:51

1 Answers1

1

After a bit of research I was able to find that SELinux was blocking the map operation. Once I added the required rule to allow that things seemed to start working fine. Apparently dovecot was able to run for a while before trying to do this and break.

Michael
  • 153
  • 1
  • 1
  • 6