I work at example.net :-) and my team's server is named tardis.example.net . Any mail sent to us must first go through our company's internal relay hosts. Although the messages are delivered to our server correctly, the recipient address is rewritten from:
As a result, our default Postfix (2.6.6) configuration refuses to deliver the message:
Nov 27 15:49:23 tardis postfix/qmgr: B6CC73FA22: from=<email@example.com>, size=3953, nrcpt=1 (queue active) Nov 27 15:49:24 tardis postfix/smtp: B6CC73FA22: to=<firstname.lastname@example.org>, orig_to=<email@example.com>, relay=outbound.example.net[172.30.113.194]:25, delay=0.71, delays=0.47/0.01/0.14/0.1, dsn=5.1.1, status=bounced (host outbound.example.net[172.30.113.194] said: 550 5.1.1 <firstname.lastname@example.org>... User unknown (in reply to RCPT TO command))
My solution to this was to change main.cf from this:
myhostname = tardis.example.net mydomain = example.net mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = tardis.example.net mydomain = example.net mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost
This works fine; by accepting mail for $mydomain, tardis.example.net now accepts incoming mail even with the recipient changed to email@example.com
The problem, however, is that all outgoing mail from our server to @example.net is now treated as local mail. Instead of being forwarded to $relayhost (outbound.example.net), Postfix attempts to deliver it to a local user on tardis.example.net .
How can I configure our server to accept incoming @example.net mail, but send ALL outgoing messages to $relayhost (with the possible exception of outgoing mail destined for @tardis.example.net, which is the only thing that should be delivered locally) ?
I looked through the FAQ on mail relaying and the various relay-related options in the documentation but could not find anything that would help me.
If you need further configuration info, I'll be happy to provide it. Thanks to anyone who can help.