Networking Forums

Networking Forums > Computer Networking > Linux Networking > postfix: smarthost/relayhost for particular domain?

Reply
Thread Tools Display Modes

postfix: smarthost/relayhost for particular domain?

 
 
Jem Berkes
Guest
Posts: n/a

 
      10-21-2003, 01:44 PM
I run my own mail servers, and outgoing mail is working fine for all
domains except (ironically) for when sending to my own ISP's email
addresses. Their MX doesn't accept incoming TCP connections from my host,
and I have no clue why.

While their domain's MX doesn't accept my connections, there are other
hosts that will; for instance, the SMTP server address that customers are
supposed to use. I was going to enable postfix's relayhost feature (like
sendmail smarthost) but this would send ALL outgoing mail through
smtp.myisp

However I really only want to resort to this type of mail delivery when the
recipient is at that particular ISP, since this is the only domain that
causes problems. Is there a way to make relahost= work for only a certain
recipient domain?

--
Jem Berkes
http://www.sysdesign.ca/
 
Reply With Quote
 
 
 
 
Jem Berkes
Guest
Posts: n/a

 
      10-21-2003, 10:43 PM
> While their domain's MX doesn't accept my connections, there are other
> hosts that will; for instance, the SMTP server address that customers
> are supposed to use. I was going to enable postfix's relayhost feature
> (like sendmail smarthost) but this would send ALL outgoing mail
> through smtp.myisp


I have found the solution (postfix is awesome!). To help out anyone who
wants to do something similar, relaying mail bound to specific addresses or
domains through a specific mail relay, here is what you do:

1. Edit /etc/postfix/transport. Here is what I added:
mts.net smtp:[smtp.mts.net]

This means: when the destination is @mts.net, send mail through
relay host smtp.mts.net. The host name is in brackets to disable MX
lookup; my intent is to use exactly that specified mail relay to
solve a quirky connectivity problem I have to the proper MX.

2. Run 'postmap /etc/postfix/transport' to update the db (mine is hash)

3. In /etc/postfix/main.cf, enable transport_maps
transport_maps = hash:/etc/postfix/transport

In my case the map is a hash file, adjust as necessary. For more detail see
'man transport' for the syntax of the transport mappings. This is a very
powerful feature!

--
Jem Berkes
http://www.sysdesign.ca/
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix with gmail as smarthost Luis Angel Fdez. Fdez. Linux Networking 1 08-22-2007 01:41 AM
mail server behind router port forwarding 25 domain static ip postfix lonux linux konqueror in progress Linux Networking 1 06-22-2007 01:28 PM
MTA - postfix Rage Linux Networking 2 10-20-2005 12:25 AM
Postfix troubles KiNgTuT99 Linux Networking 6 07-20-2005 11:21 AM
postfix: smtp relayhost requires authentication Nick E. Linux Networking 3 02-04-2004 05:47 PM



1 2 3 4 5 6 7 8 9 10 11