Postfix transport map always using catchall definition

emailpostfixsmtp

Hoping one of the Postfix experts on here can help me debug an issue I am having with transport maps. I've gone through a the recommend list of questions to try and resolve my issue with no luck.

First the problem:
I need to use a different STMP server (relay host) depending on destination email address.

I created a transport file under /etc/postfix/transport (version 2.10)

added the following entries

sender1@domainA.com      smtp:[SMTP_for_domainA.com]
sender2@secondDomain.com smtp:[SMTP_for_secondDomain.com
*                        smtp:[Default_SMTP_catch_all]

I then ran the following command postmap /etc/postfix/transport and restarted the postfix service.

Now, whenever I try to send email to sender1 or sender2 it always uses the the relay host defined under the * (catchall).

I am able to telnet to both and send email. I'm also no clear whether I should leave the relayhost= argument out of my main.cf file? Relatively new to Postfix so I am hoping someone could point me in the right direction.

Thanks!

Best Answer

You need to set transport_maps in main.cf, and remove relayhost. It sounds like you haven't done either of these.

 transport_maps = hash:/etc/postfix/transport
Related Topic