Sendmail won't send emails on CentOS 7 (Permission denied)


Apache on CentOS 7 can't send emails via Sendmail. Website front-end displays following error:

Could not execute: /usr/sbin/sendmail

/var/log/maillog file shows following error:

sendmail[2450]: NOQUEUE: SYSERR(apache): /etc/mail/ line 0: cannot open: Permission denied


Quick 'sestatus' check revealed that the issue was caused by SELinux.

Running: getsebool httpd_can_sendmail returns off, which means that Apache (httpd) doesn't have permission to send emails.

The issue was resolved by running: setsebool -P httpd_can_sendmail on

CentOS 7 LAMP server 


Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait