Multiple relay destinations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple relay destinations

Patrick Saweikis

Hello

 

            We are using postfix 2.3.8 and have it integrated with mysql and transport maps are set on a per domain basis this way (transport_maps = mysql:/etc/postfix/mysql-transport.cf, mysql-transport.cf contains the authentication and mysql query to retrieve this info).

 

            We are now trying to incorporate a way to create redundancy on the relay end, so currently we may just have the transport map set to “smtp:[10.1.1.7]” and are trying to find a way to tell it that if it cannot relay to the transport_maps location, try this other. I had done some research and found that smtp_fallback_relay should do what I need. I tried implementing this without success, I am getting “unknown mail transport error” when enabling that option, whether the transport_maps location is accessible or not.

 

            Any ideas on how we can accomplish this? Is smtp_fallback_relay the correct method to do this? Any help would be greatly appreciated. Thanks.

 

Patrick Saweikis

Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Brian Evans - Postfix List
Patrick Saweikis wrote:

>
> Hello
>
>  
>
>             We are using postfix 2.3.8 and have it integrated with
> mysql and transport maps are set on a per domain basis this way
> (transport_maps = mysql:/etc/postfix/mysql-transport.cf,
> mysql-transport.cf contains the authentication and mysql query to
> retrieve this info).
>
>  
>
>             We are now trying to incorporate a way to create
> redundancy on the relay end, so currently we may just have the
> transport map set to “smtp:[10.1.1.7]” and are trying to find a way to
> tell it that if it cannot relay to the transport_maps location, try
> this other. I had done some research and found that
> smtp_fallback_relay should do what I need. I tried implementing this
> without success, I am getting “unknown mail transport error” when
> enabling that option, whether the transport_maps location is
> accessible or not.
>
>  
>
>             Any ideas on how we can accomplish this? Is
> smtp_fallback_relay the correct method to do this? Any help would be
> greatly appreciated. Thanks.
>
>
Remember, transport_maps overrides all other settings.

The simplest way is to setup a local DNS domain (example.local for
instance) with MX records of the same priority.
Then, replace the IP with the local domain you created.
This adds a small amount of cost for each message.

Brian

Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Brian Evans - Postfix List
Brian Evans - Postfix List wrote:

> Patrick Saweikis wrote:
>  
>>
>>             We are now trying to incorporate a way to create
>> redundancy on the relay end, so currently we may just have the
>> transport map set to “smtp:[10.1.1.7]” and are trying to find a way to
>> tell it that if it cannot relay to the transport_maps location, try
>> this other. I had done some research and found that
>> smtp_fallback_relay should do what I need. I tried implementing this
>> without success, I am getting “unknown mail transport error” when
>> enabling that option, whether the transport_maps location is
>> accessible or not.
>>
>>    
> Remember, transport_maps overrides all other settings.
>
> The simplest way is to setup a local DNS domain (example.local for
> instance) with MX records of the same priority.
> Then, replace the IP with the local domain you created.
> This adds a small amount of cost for each message.
>
>  
Make that different priority.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Barney Desmond
In reply to this post by Patrick Saweikis
2009/5/9 Patrick Saweikis <[hidden email]>:
> relay to the transport_maps location, try this other. I had done some
> research and found that smtp_fallback_relay should do what I need. I tried
> implementing this without success, I am getting “unknown mail transport
> error” when enabling that option, whether the transport_maps location is
> accessible or not.

Well, how did you try to implement it? Show the output of `postconf
-n` and log entries demonstrating this failure.

As Brian says, adding the redundancy/failover at the DNS level is
probably the way to go, transport_maps are a single-valued deal. If
you care enough to use a transport map, you don't just want it going
out some other relay when there's a problem. All too often it happens
that using the "backup plan" becomes the norm (applies to all systems,
not just mail), it means the system probably needs re-working.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Wietse Venema
In reply to this post by Patrick Saweikis
Patrick Saweikis:
>             We are now trying to incorporate a way to create redundancy
> on the relay end, so currently we may just have the transport map set to
> "smtp:[10.1.1.7]" and are trying to find a way to tell it that if it
> cannot relay to the transport_maps location, try this other. I had done

Try using smtp_fallback_relay=smtp:[1.2.3.4] in main.cf, or "-o
smtp_fallback_relay=smtp:[1.2.3.4]" in master.cf. The second form
takes no spaces around the "=".

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Victor Duchovni
On Fri, May 08, 2009 at 01:45:25PM -0400, Wietse Venema wrote:

> Patrick Saweikis:
> >             We are now trying to incorporate a way to create redundancy
> > on the relay end, so currently we may just have the transport map set to
> > "smtp:[10.1.1.7]" and are trying to find a way to tell it that if it
> > cannot relay to the transport_maps location, try this other. I had done
>
> Try using smtp_fallback_relay=smtp:[1.2.3.4] in main.cf, or "-o
> smtp_fallback_relay=smtp:[1.2.3.4]" in master.cf. The second form
> takes no spaces around the "=".

But, you also may need to make sure that the primary nexthop does not
do hard 5XX rejects.

    http://archives.neohapsis.com/archives/postfix/2006-11/thread.html#1128

Far better to find a port 587 relay that does SASL auth, and will accept
your traffic from any source IP...

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Wietse Venema
Victor Duchovni:

> On Fri, May 08, 2009 at 01:45:25PM -0400, Wietse Venema wrote:
>
> > Patrick Saweikis:
> > >             We are now trying to incorporate a way to create redundancy
> > > on the relay end, so currently we may just have the transport map set to
> > > "smtp:[10.1.1.7]" and are trying to find a way to tell it that if it
> > > cannot relay to the transport_maps location, try this other. I had done
> >
> > Try using smtp_fallback_relay=smtp:[1.2.3.4] in main.cf, or "-o
> > smtp_fallback_relay=smtp:[1.2.3.4]" in master.cf. The second form
> > takes no spaces around the "=".
>
> But, you also may need to make sure that the primary nexthop does not
> do hard 5XX rejects.

Where did the OP say that this is an MUA-to-ISP scenario?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Victor Duchovni
On Fri, May 08, 2009 at 02:28:38PM -0400, Wietse Venema wrote:

> Victor Duchovni:
> > On Fri, May 08, 2009 at 01:45:25PM -0400, Wietse Venema wrote:
> >
> > > Patrick Saweikis:
> > > >             We are now trying to incorporate a way to create redundancy
> > > > on the relay end, so currently we may just have the transport map set to
> > > > "smtp:[10.1.1.7]" and are trying to find a way to tell it that if it
> > > > cannot relay to the transport_maps location, try this other. I had done
> > >
> > > Try using smtp_fallback_relay=smtp:[1.2.3.4] in main.cf, or "-o
> > > smtp_fallback_relay=smtp:[1.2.3.4]" in master.cf. The second form
> > > takes no spaces around the "=".
> >
> > But, you also may need to make sure that the primary nexthop does not
> > do hard 5XX rejects.
>
> Where did the OP say that this is an MUA-to-ISP scenario?

Perhaps I am mixing up threads. Is this the OP with the two ISP and the
DSL line that fails from time to time... ?

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

RE: Multiple relay destinations

Patrick Saweikis
In reply to this post by Brian Evans - Postfix List

>> Patrick Saweikis wrote:
>>
>> Hello
>>
>>  
>>
>>             We are using postfix 2.3.8 and have it integrated with
>> mysql and transport maps are set on a per domain basis this way
>> (transport_maps = mysql:/etc/postfix/mysql-transport.cf,
>> mysql-transport.cf contains the authentication and mysql query to
>> retrieve this info).
>>
>>  
>>
>>             We are now trying to incorporate a way to create
>> redundancy on the relay end, so currently we may just have the
>> transport map set to "smtp:[10.1.1.7]" and are trying to find a way
to

>> tell it that if it cannot relay to the transport_maps location, try
>> this other. I had done some research and found that
>> smtp_fallback_relay should do what I need. I tried implementing this
>> without success, I am getting "unknown mail transport error" when
>> enabling that option, whether the transport_maps location is
>> accessible or not.
>>
>>  
>>             Any ideas on how we can accomplish this? Is
>> smtp_fallback_relay the correct method to do this? Any help would be
>> greatly appreciated. Thanks.
>
>
>Remember, transport_maps overrides all other settings.
>
>The simplest way is to setup a local DNS domain (example.local for
>instance) with MX records of the same priority.
>Then, replace the IP with the local domain you created.
>This adds a small amount of cost for each message.
>
>Brian

This worked perfectly! Thanks for the tip -- I think I was just trying
to over-complicate things. Here is what I ended up doing:

DNS:
patsaw.local
A, mx1.patsaw.local, 10.1.1.7
A, mx2.patsaw.local, 10.1.1.12

MX, 0, mx1.patsaw.local
MX, 10, mx2.patsaw.local


Postfix for patsaw.com:
transport_maps=smtp:patsaw.local

Test1, successfully relayed to patsaw.com on 10.1.1.7

Test2, changed mx1.patsaw.local to 1.2.3.4 - Successfully delivered to
10.1.1.12


The one problem I ran into is that we normally use the format
smtp:[10.1.1.7], when I kept patsaw.local in brackets it tried to
deliver to the A record, I had to take it out of brackets for postfix to
do an mx lookup.

Thanks Again!

Reply | Threaded
Open this post in threaded view
|

Re: Multiple relay destinations

Noel Jones-2
Patrick Saweikis wrote:
> The one problem I ran into is that we normally use the format
> smtp:[10.1.1.7], when I kept patsaw.local in brackets it tried to
> deliver to the A record, I had to take it out of brackets for postfix to
> do an mx lookup.

The examples Viktor posted didn't include brackets.
The brackets disable MX lookups, as documented.  Don't use
brackets when you need MX lookups.

Glad you got it working.

   -- Noel Jones