Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper permission for sendmail.cf when apache sends mail on linux

I have a web application (bugzilla) in apache that needs to use sendmail.cf . When it tries to use sendmail I get the error:

/etc/mail/sendmail.cf: line 0: cannot open: Permission denied

the web application is in group "apache"

Permissions for sendmail look like:

-rw-r--r-- 1 root root 58624 2008-03-29 05:27 sendmail.cf

What do the permissions for sendmail.cf have to look like in order to be accessed by apache but still be secure enough to lock out everyone else.

like image 990
Atma Avatar asked Dec 18 '22 07:12

Atma


1 Answers

I have this issue in a Centos 7 and the answer was here: http://www.mysysadmintips.com/linux/servers/591-sendmail-won-t-send-emails-on-centos-7-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

like image 93
Nelson Daza Avatar answered Mar 01 '23 23:03

Nelson Daza