• Welcome to Simple Machines Community Forum. Please login or sign up.

A note on sendmail and SELinux in Red Hat Enterprise Linux

Started by manyon, August 10, 2011, 09:59:34 PM

Previous topic - Next topic

manyon

Hi everyone,
  when installing SMF 2.0 on RHEL6 recently, I found that emails were not being sent, with the error
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
/usr/sbin/getsebool httpd_can_sendmail
which will report
httpd_can_sendmail --> {on|off}
and if it is off, you can turn it on using
sudo setsebool -P httpd_can_sendmail 1
with the "-P" for persistent (across reboots).

Hope this helps someone!

manyon

stukerr


Frank_NL

Great post, thanks.

Same solution goes for Scientific Linux.

/Frank.


snarfblat

I tried to use this to fix the issue I am having with the forum not sending out email.  The command reply is setsebool: SELinux is disabled.  Is there anything else I can try to get this to work?

青山 素子

If SELinux is disabled, then this doesn't apply to you. Start a new support topic with an explanation on your issue.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Frank_NL

Upgraded to CentOS 7, and the same solution works there too.

Advertisement: