Wednesday, June 16, 2010

Fedora, Postfix, and SELinux

Getting these types of errors in /var/log/maillog?

Jun 16 09:47:14 myhostname postfix/local[25474]: C269521F8C: to=, relay=local, delay=0.07, delays=0.02/0/0/0.04, dsn=5.2.0, status=bounced (cannot update mailbox /var/mail/root for user root. unable to create lock file /var/mail/root.lock: Permission denied)

You're running into SELinux denials for local mail delivery. In Fedora, correct that with:

# togglesebool allow_postfix_local_write_mail_spool

EDIT: I just realized that togglesebool only changes the running config and does not survive reboots. The permanent fix is:

# setsebool -P allow_postfix_local_write_mail_spool 1


Anonymous said...

you forgot the value "1" after the boolean, so the command should be:

setsebool -P allow_postfix_local_write_mail_spool 1

John Saalwaechter said...

Thanks for the catch. I updated the original post.