When I try and send mail I see this in the maillog: Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open /etc/postfix/main.cf: Permission denied But /etc/postfix/main.cf is world readable: $ ls -l /etc/postfix/main.cf -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cf
On 06.09.2018 21:15, Larry Martell wrote:> When I try and send mail I see this in the maillog: > > Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open > /etc/postfix/main.cf: Permission denied > > But /etc/postfix/main.cf is world readable: > > $ ls -l /etc/postfix/main.cf > -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cf >do a ls -alZ /etc/postfix/main.cf very probale is invalid SElinux File context is should show -rw-r--r--. root root system_u:object_r:postfix_etc_t:s0 /etc/postfix/main.cf
On Thu, Sep 6, 2018 at 3:37 PM, Walter H. <Walter.H at mathemainzel.info> wrote:> On 06.09.2018 21:15, Larry Martell wrote: >> >> When I try and send mail I see this in the maillog: >> >> Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open >> /etc/postfix/main.cf: Permission denied >> >> But /etc/postfix/main.cf is world readable: >> >> $ ls -l /etc/postfix/main.cf >> -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cf >> > do a > ls -alZ /etc/postfix/main.cf > very probale is invalid SElinux File context > is should show > > -rw-r--r--. root root system_u:object_r:postfix_etc_t:s0 > /etc/postfix/main.cf$ ls -alZ /etc/postfix/main.cf -rw-r--r--. root root system_u:object_r:postfix_etc_t:s0 /etc/postfix/main.cf
On 06/09/18 20:15, Larry Martell wrote:> When I try and send mail I see this in the maillog: > > Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open > /etc/postfix/main.cf: Permission denied > > But /etc/postfix/main.cf is world readable: > > $ ls -l /etc/postfix/main.cf > -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cfHow are you trying to send mail? Is it by chance through a web based application? If so, you may need to set the SELinux boolean httpd_can_sendmail. Otherwsie, check/restore default SELinux labelling for /etc/postfix/main.cf
On Thu, Sep 6, 2018 at 3:42 PM, Phil Perry <pperry at elrepo.org> wrote:> On 06/09/18 20:15, Larry Martell wrote: >> >> When I try and send mail I see this in the maillog: >> >> Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open >> /etc/postfix/main.cf: Permission denied >> >> But /etc/postfix/main.cf is world readable: >> >> $ ls -l /etc/postfix/main.cf >> -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cf > > > How are you trying to send mail? Is it by chance through a web based > application?No just testing from the command line with mail. But I will need to be able to send mail from a PHP app.> If so, you may need to set the SELinux boolean httpd_can_sendmail.OK - I just did that - thanks!> > Otherwsie, check/restore default SELinux labelling for /etc/postfix/main.cfThat looks correct: -rw-r--r--. root root system_u:object_r:postfix_etc_t:s0 /etc/postfix/main.cf
On 07/09/18 07:15, Larry Martell wrote:> When I try and send mail I see this in the maillog: > > Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open > /etc/postfix/main.cf: Permission denied > > But /etc/postfix/main.cf is world readable: > > $ ls -l /etc/postfix/main.cf > -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cfCheck the output of: rpm -Va postfix\* If it shows no output then everything should be fine. Otherwise the output will show you what files have had permissions changed (or anything else changed) since postfix was installed. I don't think this checks selinux contexts, but it should find any other permissions issues. You can fix by re-installing postfix: yum reinstall postfix\* Peter
On Thu, Sep 6, 2018 at 9:13 PM, Peter <peter at pajamian.dhs.org> wrote:> On 07/09/18 07:15, Larry Martell wrote: >> When I try and send mail I see this in the maillog: >> >> Sep 6 11:59:48 postfix/sendmail[11059]: fatal: open >> /etc/postfix/main.cf: Permission denied >> >> But /etc/postfix/main.cf is world readable: >> >> $ ls -l /etc/postfix/main.cf >> -rw-r--r--. 1 root root 27176 Jun 9 2014 /etc/postfix/main.cf > > Check the output of: > > rpm -Va postfix\* > > If it shows no output then everything should be fine.Got no output.> Otherwise the > output will show you what files have had permissions changed (or > anything else changed) since postfix was installed. > > I don't think this checks selinux contexts, but it should find any other > permissions issues. > > You can fix by re-installing postfix: > > yum reinstall postfix\*I did that anyway, and it working now. Thanks!