Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a Postfix SMTP server that's bound to two IP addresses and serves mail for two different domains. We can't change the domains to both use the same, single IP. Both IP addresses have reverse DNS

  • 1.1.1.1 reverses to mail.domain1.com
  • 2.2.2.2 reverses to mail.domain2.com

In our Postfix config I have

myhostname = mail.domain1.com
myhostname = mail.domain2.com

inet_interfaces = 1.1.1.1, 2.2.2.2

smtpd_banner = $myhostname Mail Server

(And some other stuff, which I think is irrelevant)

Using MXToolbox, running the smtp test command on mail.domain2.com returns everything as OK, however running it on mail.domain1.com returns an error because Postfix is identifying itself as 'mail.domain2.com' in the SMTP banner, how do I get it to return the correct banner based on the external IP address used?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You need to edit master.cf

replace the line starting with "smtp" with:

1.1.1.1:smtp  inet  n  - - - -  smtpd -o myhostname=mail.domain1.com
2.2.2.2:smtp  inet  n  - - - -  smtpd -o myhostname=mail.domain2.com

If you set one variable multiple times only one of them will remain.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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