Skip to content

Incorrect Postfix files/folders ownership #1

@alexeapps

Description

@alexeapps

@ihorman, after provisioning a Plesk environment, Postfix will fail to start because of incorrect ownership of some files/folders:

# cat /var/log/mail.err
Nov 15 16:06:23 node26556-plesk111 postfix/master[912]: fatal: open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied
Nov 15 16:06:24 node26556-plesk111 postfix/postfix-script[1454]: fatal: the Postfix mail system is not running
Nov 15 16:10:58 node26556-plesk111 postfix/master[5279]: fatal: remove public/pickup: Permission denied

Some files/folders are owned by an user/group with different UID than postfix:

# ls -al /var/lib/postfix
total 12
drwxr-xr-x  2  105  113 4096 Sep 20 15:18 .
drwxr-xr-x 51 root root 4096 Oct 30 16:30 ..
-rw-------  1  105  113   33 Sep 20 15:18 master.lock
# ls -al /var/spool/postfix/
total 80
drwxr-xr-x 20 root root 4096 Sep 20 15:18 .
drwxr-xr-x  7 root root 4096 Oct 30 16:27 ..
drwx------  2  105 root 4096 Sep 20 15:18 active
drwx------  2  105 root 4096 Sep 20 15:18 bounce
drwx------  2  105 root 4096 Sep 20 15:18 corrupt
drwx------  2  105 root 4096 Sep 20 15:18 defer
drwx------  2  105 root 4096 Sep 20 15:18 deferred
drwxr-xr-x  2 root root 4096 Nov 15 16:06 dev
drwxr-xr-x  3 root root 4096 Nov 15 16:10 etc
drwx------  2  105 root 4096 Sep 20 15:18 flush
drwx------  2  105 root 4096 Sep 20 15:18 hold
drwx------  2  105 root 4096 Sep 20 15:18 incoming
drwxr-xr-x  3 root root 4096 Sep 20 15:18 lib
drwx-wx--T  2  105  114 4096 Sep 20 15:18 maildrop
drwxr-xr-x  2 root root 4096 Sep 20 15:18 pid
drwx------  2  105 root 4096 Sep 20 15:19 private
drwx--s---  2  105  114 4096 Sep 20 15:19 public
drwx------  2  105 root 4096 Sep 20 15:18 saved
drwx------  2  105 root 4096 Sep 20 15:18 trace
drwxr-xr-x  3 root root 4096 Sep 20 15:18 usr

This can be corrected by assigning correct ownership and then Postfix will start:

# chown -R postfix.postfix /var/lib/postfix/
# find /var/spool/postfix/ -user 105 -exec chown postfix '{}' '+'
# chown -R postfix.postfix /var/spool/postfix/maildrop/ /var/spool/postfix/public/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions