Advertisement:

Author Topic: A note on sendmail and SELinux in Red Hat Enterprise Linux  (Read 17668 times)

Offline manyon

  • Newbie
  • *
  • Posts: 4
A note on sendmail and SELinux in Red Hat Enterprise Linux
« 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
Code: [Select]
sendmail: fatal: chdir /var/spool/postfix: Permission deniedshowing 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_sendmailwhich 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 1with the "-P" for persistent (across reboots).

Hope this helps someone!

 manyon

Offline stukerr

  • Newbie
  • *
  • Posts: 1
Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
« Reply #1 on: August 31, 2011, 10:54:49 AM »
Awesome stuff, helped me a lot! Many thanks

Offline Frank_NL

  • Newbie
  • *
  • Posts: 1
Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
« Reply #2 on: August 02, 2012, 06:47:48 AM »
Great post, thanks.

Same solution goes for Scientific Linux.

/Frank.

Offline umang1982

  • Newbie
  • *
  • Posts: 1
Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
« Reply #3 on: October 09, 2012, 07:33:34 PM »
Worked like a charm. Thanks!