Postfix transport map always using catchall definition

user203913 asked:

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

[email protected]      smtp:[SMTP_for_domainA.com]
[email protected] 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!

My 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

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.