another meaningless subtitle

Nginx, PHP-FPM, SELinux and sendmail

· by mafio · Read in about 1 min · (76 Words)
CentOS 7 nginx php-fpm SELinux

Since I am a real master at forgiving things I am writing this one down.
PHP mail function relies on sendmail but SELinux by default block webservers from sending emails, the usual error that pop-out is:

sendmail[16328]: NOQUEUE: SYSERR(nginx): /etc/mail/sendmail.cf: line 0: cannot open: Permission denied

Allow webservers to send email is as easy as editing the appropriate SELinux boolean:

setsebool -P httpd_can_sendmail 1

Use “sestatus” to check SELinux booleans:

sestatus -b | grep -i sendmail