I have Postfix listening on several ports for incoming mail. E.g. ports 25 and 587. I'd like to see in the logs the destination port of each incoming connection.
syslog_name in the smtpd options in
/etc/postfix/master.cf. This changes the name of the process in the standard-format log line. The default is
postfix/smtpd. So to change it for the
submission line (port 587), add this to the options:
Note that the default process name is kept as a prefix. Don't include "/smtpd" because this is added automatically.
Example default log line:
Sep 28 01:22:28 XXXXXX postfix/smtpd: connect from unknown[22.214.171.124]
Example "augmented" log line:
Sep 28 01:22:28 XXXXXX postfix-submission/smtpd: connect from unknown[126.96.36.199]
Warning: Do not change this option in
/etc/postfix/main.cf, or it will change the output for all of Postfix's listening ports.