[SOLVED] Postfix fatal: open /etc/postfix/main.cf: Permission denied

Discussion in 'Server Operation' started by Skid101, Jun 5, 2017.

  1. Skid101

    Skid101 New Member

    I'm on Debian 8 and not sure what I have done as whenever I try and send an email using Roundcube it says there was an error sending the message, so I checked the logs and found:

    postfix/sendmail[22146]: fatal: open /etc/postfix/main.cf: Permission denied

    Everything was working a couple of days ago and I have not changed anything since, not even installed updates.

    So I tried:

    sudo chown root:root /etc/postfix/main.cf
    sudo chmod 0644 /etc/postfix/main.cf

    Still no luck after restarting both Postfix and Dovecot :(

    When using `ls` to view permissions:

    -rw-r--r-- 1 root root 2363 Jun 3 23:32 /etc/postfix/main.cf

    Here are my permissions for `/etc/postfix`

    drwxr-x--- 3 root root 4096 May 30 19:44 .
    drwxr-xr-x 101 root root 4096 Jun 4 00:58 ..
    -rw-r----- 1 root root 329 May 30 18:08 dynamicmaps.cf
    -rw-r--r-- 1 root root 2367 Jun 4 00:40 main.cf
    -rw-r----- 1 root root 6046 Jun 1 13:39 master.cf
    -rw-r----- 1 root root 149 May 30 19:43 mysql-virtual-alias-maps.cf
    -rw-r----- 1 root root 143 May 30 19:44 mysql-virtual-email2email.cf
    -rw-r----- 1 root root 139 May 30 19:45 mysql-virtual-mailbox-domains.cf
    -rw-r----- 1 root root 139 May 30 19:52 mysql-virtual-mailbox-maps.cf
    -rwxr-x--- 1 root root 28047 Apr 29 17:01 post-install
    -rw-r----- 1 root root 20281 Apr 29 17:01 postfix-files
    -rwxr-x--- 1 root root 8861 Apr 29 17:01 postfix-script
    drwxr-x--- 2 root root 4096 Apr 29 17:01 sasl

    Really not sure what to do now as my email server has basically been unusable since this happened.
     
  2. Skid101

    Skid101 New Member

    Anyone on this?
    SELinux is total disabled and still having issues on this.
     
  3. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    you need 755 for /etc/postfix as postfix is not in the root-group.
    chmod 755 /etc/postfix
     
    Skid101 likes this.
  4. Skid101

    Skid101 New Member

    OMG it worked! Thank you so much, my issue is now solved!
     

Share This Page