Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a mail server that relays e-mails for two different domains. I want the smtp_helo_name to be different based on the domain. I'm assuming there is no way to do this via checking the mail headers, so I was wondering if there was a way to do it by sending mail for one domain to one IP address, and mail for the other to another.

I tried modified to do this:

localhost:smtp      inet n - n - - smtpd
ip1:smtp inet n - n - - smtpd
ip2:smtp  inet n - n - - smtpd -o

And setting smtp_helo_name to $myhostname in

I also tried doing -o smtp_helo_name instead, neither work. Any suggestions would be great.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

This should work (not tried it, though):

Define a separate transport for the other domain and then route mail to this transport using sender_dependent_relayhost_maps option in

Something like this:

In '':

smtp-other      unix  -       -       n       -       -       smtp

In '':

sender_dependent_relayhost_maps = hash:/etc/postfix/relay_maps

In 'relay_maps':

my.other.domain    smtp-other:

And run 'postmap /etc/postfix/relay_maps'

share|improve this answer
Sorry for the delay, I'll try it out. –  William Jun 21 '10 at 15:23
Going to accept this as it answered my question, although I'm going to end up running multiple postfix instances as I'll be handling relay for multiple domains and each will have a unique IP address. There doesn't seem to be a solid way to have postfix know to send e-mail based off what interface was used to receive. –  William Jul 8 '10 at 21:25
Starting multiple smtpd (listening on different interfaces) from one should work – you would be able to use different smtpd options there and those could probably be propagated to the rest of the Postfix framework. Though, that is just a guess – I would have to think longer about a detailed solution and if it is possible at all. –  Jacek Konieczny Jul 13 '10 at 19:33

Take look at Managing multiple Postfix instances on a single host, but be aware that multi-instance support is only available with Postfix version 2.6 and later.

share|improve this answer
Postfix is so flexible, that it is very rarely needed to have more than one instance of it. You can always have multiple instances of most postfix components (configured in and that is usually enough for whole lot of scenarios. –  Jacek Konieczny Mar 12 '10 at 7:44

Your Answer


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.