Postfix ignore catchall relayhost

October 13, 2011    email postfix relayhost

Postfix has an option where you can setup a relayhost to send all mail to another mail server. It looks something like

relayhost = []:25

So that will send all mail being sent out from the server to on port 25. So what happens if you want to send mail that is sent to out that server and not through another relay. You would do the following in

transport_maps = hash:/etc/postfix/transport

Then your /etc/postfix/transport would look something like :
* smtp:[]:25

Then you want to run

postmap /etc/postfix/transport

Then reload postfix

service postfix reload

Now all mail for will send out that server while all other mail will go through

comments powered by Disqus