Advertisement:

Author Topic: A note on sendmail and SELinux in Red Hat Enterprise Linux  (Read 21666 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!

Offline snarfblat

  • Semi-Newbie
  • *
  • Posts: 13
Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
« Reply #4 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?

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 16,511
  • 戦場ヶ原、蕩れ!
    • motokochan on GitHub
    • @motokochan on Twitter
    • Animeneko Network
Re: A note on sendmail and SELinux in Red Hat Enterprise Linux
« Reply #5 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.
Motoko-chan
Director, Simple Machines

Just like... making of enemies / 負ける気しない やめるきない / You are cool but fool - Charisma.com 『HATE』

Note: I am not a member of the Simple Machines Forum project.