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

Javascript Form Validation

It's real simple. All you need to do is call a javascript function in a html  " onsubmit " in the form tag as a javascript return, like this       <form method="post" action="dosomething.php" onsubmit="return validateForm();"> If the code completes ok, the form is then sent to the page listed in "action" http://www.w3schools.com/js/js_form_validation.asp If the function specified in the onsubmit returns false, then the form is not sent to the page mentioned in action.