The Postfix parameter smtpd_banner
sets the text of a server's SMTP greeting banner. The default setting is:
smtpd_banner = $myhostname ESMTP $mail_name
My mail server has several unique IP addresses assigned to it, one per domain for which it hosts email. In other words, something like this:
203.0.113.1
forexample1.com
203.0.113.2
forexample2.com
203.0.113.3
forexample3.com
A sending server wanting to send email to user@example2.com
would access the server using example2.com
and 203.0.113.2
.
I would like the SMTP banner to reflect the domain that is being used to access the mail server. For example, someone accessing the server using example2.com
or 203.0.113.2
should see the SMTP Banner:
example2.com ESMTP Postfix
Anyone accessing using the other domains or IP addresses should see the respective domain printed in the place of $myhostname
in the default setting.
Is this possible with Postfix, preferably without running multiple instances of Postfix, and if so, how?