lava / dockermail

Ready-to-use email server + (optional) web mail + (optional) caldav, carddav and a kitchen sink in a docker container
MIT License
301 stars 59 forks source link

Leave ownership of postfix config files with root #6

Closed lihop closed 9 years ago

lihop commented 9 years ago

Hi, and thanks for the repository.

According to the postfix documentation both the main.cf and master.cf files should be owned by root. Furthermore, running postfix check in the running dovecot container returns the following warnings:

postfix/postfix-script: warning: not owned by root: /etc/postfix
postfix/postfix-script: warning: not owned by root: /etc/postfix/dynamicmaps.cf
postfix/postfix-script: warning: not owned by root: /etc/postfix/main.cf
postfix/postfix-script: warning: not owned by root: /etc/postfix/master-additional.cf
postfix/postfix-script: warning: not owned by root: /etc/postfix/master.cf
postfix/postfix-script: warning: not owned by root: /etc/postfix/post-install
postfix/postfix-script: warning: not owned by root: /etc/postfix/postfix-files
postfix/postfix-script: warning: not owned by root: /etc/postfix/postfix-script
postfix/postfix-script: warning: not owned by root: /etc/postfix/sasl

Removing the line in the Dockerfile which gives the postfix user ownership of the files in /etc/postfix results in the following set of permissions/ownership:

-rw-r--r-- 1 root root   274 Nov 30 06:39 dynamicmaps.cf
-rw-r--r-- 1 root root  2478 Nov 30 02:43 main.cf
-rw-r--r-- 1 root root   757 Nov 30 02:43 master-additional.cf
-rw-r--r-- 1 root root  6825 Nov 30 06:39 master.cf
-rwxr-xr-x 1 root root 28047 Feb 12  2014 post-install
-rw-r--r-- 1 root root 20281 Feb 12  2014 postfix-files
-rwxr-xr-x 1 root root  8861 Feb 12  2014 postfix-script
drwxr-xr-x 1 root root     0 Feb 12  2014 sasl
drwxr-xr-x 1 root root    82 Nov 30 06:40 tmp
-rw-r--r-- 1 root root    72 Nov 30 06:39 virtual
-rw-r--r-- 1 root root    12 Nov 30 06:39 virtual-mailbox-domains
-rw-r--r-- 1 root root    82 Nov 30 06:40 virtual-mailbox-maps
-rw-r--r-- 1 root root 12288 Nov 30 09:01 virtual-mailbox-maps.db
-rw-r--r-- 1 root root 12288 Nov 30 09:01 virtual.db

These are the same permissions/ownership as on my (non-dockerized) mail server, which has been running smoothly for about a year. Also postfix check is happy with this as it doesn't raise any errors or warnings, and the container runs fine :smile:

lava commented 9 years ago

Hi, and thanks for the contribution!