1

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.

2

Use 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:

-o syslog_name=postfix-submission

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[11737]: connect from unknown[203.194.109.130]

Example "augmented" log line:

Sep 28 01:22:28 XXXXXX postfix-submission/smtpd[11737]: connect from unknown[203.194.109.130]

Warning: Do not change this option in /etc/postfix/main.cf, or it will change the output for all of Postfix's listening ports.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.