SMF Support > Server Performance and Configuration

A note on sendmail and SELinux in Red Hat Enterprise Linux

(1/1)

manyon:
Hi everyone,
  when installing SMF 2.0 on RHEL6 recently, I found that emails were not being sent, with the error

--- Code: ---sendmail: fatal: chdir /var/spool/postfix: Permission denied
--- End code ---
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: ---/usr/sbin/getsebool httpd_can_sendmail
--- End code ---
which will report

--- Code: ---httpd_can_sendmail --> {on|off}
--- End code ---
and if it is off, you can turn it on using

--- Code: ---sudo setsebool -P httpd_can_sendmail 1
--- End code ---
with the "-P" for persistent (across reboots).

Hope this helps someone!

 manyon

stukerr:
Awesome stuff, helped me a lot! Many thanks

Frank_NL:
Great post, thanks.

Same solution goes for Scientific Linux.

/Frank.

umang1982:
Worked like a charm. Thanks!

Navigation

[0] Message Index

Go to full version