Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone know of an entry I can 1

Status
Not open for further replies.

Freemansweb

Technical User
Aug 26, 2003
53
US
Does anyone know of an entry I can make in the .cf file that will force emails going to certain domains to relay through my ISP and other domains to be sent directly by my smtp server? Currently all outgoing email is set to relay through my ISP, I can change an entry to send all directly, but I would like to make it distinguish how the mail is sent by the domain.
 
Freemansweb,
This is fairly easy to do. What you are looking for is a transport map. In your main.cf you would add a line like:
Code:
transport_maps = hash:/etc/postfix/transports
then in /etc/postfix/transports list your transports. E.g.
Code:
# Next three domains are sent via myisp.com relay
somecompany.com smtp:relay.myisp.com
anothercompany.com smtp:relay.myisp.com
that.net smtp:relay.myisp.com
# All other addresses treat as if transport_map didn't exist
* :
build the map and reload post fix and you should be done. You can of course use other lookup table types if you wish. I prefer mysql for ease of maint, but I know not everyone does.

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top