Opened 8 months ago

Last modified 8 months ago

#68135 assigned defect

postfix creates incorrect permissions on postfix.log after updates

Reported by: essandess (Steve Smith) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: postfix

Description

postfix fails to launch after every update because the file maillog_file = /opt/local/var/log/mail/postfix.log (set by /opt/local/etc/postfix/main.cf) is created with incorrect permissions.

Diagnostics after update:

$ sudo port load postfix
# port 25 fails to open
$ sudo less /opt/local/var/log/mail/postfix.log

Sep 07 06:50:08 mail /postfix-script[55273]: fatal: Postfix integrity check fail
ed!

$ sudo postsuper -sv
postsuper: name_mask: all
postsuper: inet_addr_local: configured 4 IPv4 addresses
postsuper: inet_addr_local: configured 25 IPv6 addresses
postsuper: queue: defer
postsuper: fatal: open logfile '/opt/local/var/log/mail/postfix.log': cannot open file: Permission denied

$ ls -l /opt/local/var/log/mail/postfix.log
-rw-r-----  1 root  admin  1041875 Sep  7 06:51 /opt/local/var/log/mail/postfix.log

Fix:

$ sudo chgrp _postfix /opt/local/var/log/mail/postfix.log
$ sudo chmod g+w /opt/local/var/log/mail/postfix.log
$ sudo postsuper -sv
postsuper: name_mask: all
postsuper: inet_addr_local: configured 4 IPv4 addresses
postsuper: inet_addr_local: configured 25 IPv6 addresses
postsuper: queue: defer
postsuper: queue: bounce
postsuper: queue: maildrop
postsuper: warning: bogus file name: maildrop/.turd_postfix
postsuper: queue: incoming
postsuper: queue: active
postsuper: queue: deferred
postsuper: queue: hold
postsuper: queue: flush

$ ls -l /opt/local/var/log/mail/postfix.log
-rw-rw----  1 root  _postfix  1043322 Sep  7 07:02 /opt/local/var/log/mail/postfix.log

Change History (1)

comment:1 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: jmroot removed
Owner: set to jmroot
Status: newassigned

I wonder how this is happening. A postfix build log doesn't even contain any occurrences of the string "postfix.log".

Note: See TracTickets for help on using tickets.