Before I clarify my question I need to explain the current setup.
We've got 1 Postfix server that can receive mail and store it in a mailbox. Some clients of ours have their own Exchange server, but we still provide a POP3 box on our Postfix server. The DNS of their domain is setup to first try to deliver mail to the Exchange server, if that one can't be reached deliver it to our Postfix server. If mail is being delivered to the Postfix server the mail gets stored inside a POP3 account. When the Exchange server is back online again it uses the POP-Locator to read the contents of the POP3 mailbox, download the mails and distribute them among the mailboxes on the Exchange server.
This all works very well. Because during an outage clients can still logon to our webmail and read important mail. This is a feature we'd like to keep.
The problem however is, that most clients also host their website on the same server that runs Postfix. When software running on that server tries to deliver mail to one of the clients email addresses it delivers it locally. What we want is Postfix to use MX lookup to see to which server the mail should be delivered.
For a long time now I've been trying to figure out to do this. I have the Postfix book and read through it. Looked up many configuration examples and other resources on the internet.
So far I've been trying to use
transport_maps = hash:/etc/postfix/transport and list the specific domains in there, run
postmap to regenerate the lookup tables and do a
postfix reload. Whatever I try to do mail is being delivered locally.
To add some more context, we use Courier and have listed all domains in
virtual_alias_maps = hash:/etc/postfix/virtual.
Any help would be much appreciated.
example.com postmaster @example.com someuseraccount