We currently have postfix handling emails generated by a number of apps. A number of these emails are destined for users inside the organisation, whose mail is on an Exchange server in the same site as the postfix box.
I'm looking for a way to do this, but my Google-fu is letting me down:
If the recipient domain is one of our domains, deliver the mail to host mail.example.com. All other mail is delivered by looking up the MX record/s and processing normally.
Edit: to clarify, the apps generating the emails are sending to users outside of our organisation too, postfix is not receiving mail at all.
Instructions work for Ubuntu, you may need to adjust for other distros.
Add the following to /etc/postfix/main.cf:
Create the file /etc/postfix/transport:
Create the file /etc/postfix/relay_recipients:
Run these commands:
Sounds like your postifx box is acting as a secondary MX (with Exchange as the primary). Just configure it as such.