Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: manyon on August 10, 2011, 09:59:34 PM

Title: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: manyon on August 10, 2011, 09:59:34 PM
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
Title: Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: stukerr on August 31, 2011, 10:54:49 AM
Awesome stuff, helped me a lot! Many thanks
Title: Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: Frank_NL on August 02, 2012, 06:47:48 AM
Great post, thanks.

Same solution goes for Scientific Linux.

/Frank.
Title: Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: umang1982 on October 09, 2012, 07:33:34 PM
Worked like a charm. Thanks!
Title: Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: snarfblat on June 24, 2014, 06:08:28 PM
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?
Title: Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: 青山 素子 on June 24, 2014, 07:23:04 PM
If SELinux is disabled, then this doesn't apply to you. Start a new support topic with an explanation on your issue.
Title: Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
Post by: Frank_NL on October 04, 2014, 03:07:19 PM
Upgraded to CentOS 7, and the same solution works there too.