Postfix On CentOS 7

Home » CentOS » Postfix On CentOS 7
CentOS 7 Comments

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

7 thoughts on - Postfix On CentOS 7

  • 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

  • How 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

  • No just testing from the command line with mail. But I will need to be able to send mail from a PHP app.

    OK – I just did that – thanks!

    That looks correct:

    -rw-r–r–. root root system_u:object_r:postfix_etc_t:s0 /etc/postfix/main.cf

  • Check 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