Skip to main content

Apache gets sendmail permission denied in selinux

From http://www.simplemachines.org/community/index.php?topic=446074.0

Hi everyone,
  when installing SMF 2.0 on RHEL6 recently, I found that emails were not being sent, with the error
Code: [Select]
sendmail: fatal: chdir /var/spool/postfix: Permission denied
showing up in /var/log/httpd/error_log.  This was caused by the apache user not having SELinux permission to send email. This could also occur on other distributions which use SELinux (particularly Fedora and CentOS, but possibly others as well), if it is set to "Enforcing".

You can check this by using
Code: [Select]
/usr/sbin/getsebool httpd_can_sendmail
which will report
Code: [Select]
httpd_can_sendmail --> {on|off}
and if it is off, you can turn it on using
Code: [Select]
sudo setsebool -P httpd_can_sendmail 1
with the "-P" for persistent (across reboots).


Important note, it can look like it's doing nothing, but it actually is.

It will come back in about 1 minute



Comments

Popular posts from this blog