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

NMAP

It's been about 15 years since I used NMAP, I forgot how useful the tool is. To find out what services are running on an IP address simply use something like nmap -n -v -p1-10000 x.x.x.x -n tells nmap not to do name resolution (saves about 13 seconds if the IP you're scanning isn't in DNS_ -v verbose -p1-10000 says scan ports 1 to 10,000 (otherwise nmap will only scan the first 1000 ports)