Sharing single SMTP domain between Postfix and Exchange

exchangepostfix

Greetings.

I have a working Postfix configuration, but no Postfix admin. Mail is being correctly delivered to all recipients. Spam filtering, etc. all work fine.

I want to configure Postfix to share a single SMTP domain and do the following:
– if the receipient exists locally (e.g. if alice@junk.com has a local maildrop), continue to deliver mail as it now does
– if alice@junk.com does not exist, forward the mail to an Exchange server

Suggestions and thoughts on the best way to make this work?

Best Answer

I'm not a hardcore Postfix admin, but I'm thinking that the "fallback_transport" configuration parameter (see http://www.postfix.org/postconf.5.html#fallback_relay) is what you're probably looking for.

You'll want something like:

fallback_transport = smtp:[x.x.x.x]

Have a look at the "local_recipient_maps" parameter, too (http://www.postfix.org/postconf.5.html#local_recipient_maps). You're going to want to set that to blank to stop Postfix from rejecting mail from unknown local recipients.

If you want the complementary function on the Exchange side (so that replies from Exchange to emails sent by Postfix recipients "go through") have a look at the "Forward all messages with unresolved recipients to host" setting in Exchange 2003 (see http://technet.microsoft.com/en-us/library/aa998492(EXCHG.65).aspx), or the "Internal Relay Domain" feature in Exchange 2007 (see http://technet.microsoft.com/en-us/library/bb676395.aspx).

You do run the risk of creating mail loops between Exchange and Postfix for messages sent to unknown local recipients from either mail system, but the messages will time out so, unless a lot of users are generating bogus traffic, it probably won't matter too much.