Transport Maps

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

Transport Maps

Linux Addict
I have a postfix MTA server running. I was asked to setup relay mail to a specific domain thru MX record.

Domain - Example.com
An A record smtp.example.com

In simple, When I send a mail to @example.com,  postfix must send the mail to the MX records of smtp.example.com.   

I tried using transport maps,  "example.com      :[smtp1.example.com]"   and  " example.com   smtp:[smtp1.example.com], but of them didn't use smtp.example.com.


Please help me set this one up.


~LA






Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Ralf Hildebrandt
* Linux Addict <[hidden email]>:

> I have a postfix MTA server running. I was asked to setup relay mail to a
> specific domain thru MX record.
> Domain - Example.com
> An A record smtp.example.com
> MX Records smtp.example.com - smtp1.example.com and smtp2.example.com.
>
> In simple, When I send a mail to @example.com,  postfix must send the mail
> to the MX records of smtp.example.com.
>
> I tried using transport maps,  "example.com      :[smtp1.example.com]"   and
>  " example.com   smtp:[smtp1.example.com], but of them didn't use
> smtp.example.com.

example.com   smtp.example.com

--
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  [hidden email] | http://www.charite.de
           
Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Ralf Hildebrandt
* Ralf Hildebrandt <[hidden email]>:

> > In simple, When I send a mail to @example.com,  postfix must send the mail
> > to the MX records of smtp.example.com.

> example.com   smtp.example.com

OK, not too sure if Postfix will perform an MX lookup for the RHS
(smtp.example.com in this example). Please try

--
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  [hidden email] | http://www.charite.de
           
Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Simon Waters
In reply to this post by Linux Addict
On Tuesday 21 July 2009 16:53:52 Linux Addict wrote:
>
> I tried using transport maps,  "example.com      :[smtp1.example.com]"  
> and " example.com   smtp:[smtp1.example.com], but of them didn't use
> smtp.example.com.

Not clear what you mean here.

Documentation of "transport" (man transport) suggests you don't want the "[]"
if you want MX lookup.

So I think you want:

example.com smtp:smtp.example.com
Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Linux Addict
In reply to this post by Ralf Hildebrandt


On Tue, Jul 21, 2009 at 12:00 PM, Ralf Hildebrandt <[hidden email]> wrote:
* Ralf Hildebrandt <[hidden email]>:

> > In simple, When I send a mail to @example.com,  postfix must send the mail
> > to the MX records of smtp.example.com.

OK, not too sure if Postfix will perform an MX lookup for the RHS
(smtp.example.com in this example). Please try

--
Ralf Hildebrandt
 Geschäftsbereich IT | Abteilung Netzwerk
 Charité - Universitätsmedizin Berlin
 Campus Benjamin Franklin
 Hindenburgdamm 30 | D-12203 Berlin
 Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
 [hidden email] | http://www.charite.de


I just tried, Its NOT  using MX records of smtp.example.com. I can manipulate it thru DNS, but will more comfortable if we can do it through Postfix.


Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Clunk Werclick
On Tue, 2009-07-21 at 12:05 -0400, Linux Addict wrote:

>
>
> On Tue, Jul 21, 2009 at 12:00 PM, Ralf Hildebrandt
> <[hidden email]> wrote:
>         * Ralf Hildebrandt <[hidden email]>:
>        
>         > > In simple, When I send a mail to @example.com,  postfix
>         must send the mail
>         > > to the MX records of smtp.example.com.
>        
>        
>         > example.com      smtp.example.com
>        
>        
>         OK, not too sure if Postfix will perform an MX lookup for the
>         RHS
>         (smtp.example.com in this example). Please try
>        
>        
>         --
>         Ralf Hildebrandt
>          Geschäftsbereich IT | Abteilung Netzwerk
>          Charité - Universitätsmedizin Berlin
>          Campus Benjamin Franklin
>          Hindenburgdamm 30 | D-12203 Berlin
>          Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
>          [hidden email] | http://www.charite.de
>        
>        
>
> I just tried, Its NOT  using MX records of smtp.example.com. I can
> manipulate it thru DNS, but will more comfortable if we can do it
> through Postfix.
>
>
>
What about plain old:

smtp:

and nothing else. I was trying to day to do the opposite but it kept
looking up the mx for the destination domain when I did not have a
transport map.

--
-----------------------------------------------------------
C Werclick .Lot
Technical incompetent
Loyal Order Of The Teapot.

This e-mail and its attachments is intended only to be used as an e-mail
and an attachment. Any use of it for other purposes other than as an
e-mail and an attachment will not be covered by any warranty that may or
may not form part of this e-mail and attachment.



Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Linux Addict
In reply to this post by Simon Waters


On Tue, Jul 21, 2009 at 12:03 PM, Simon Waters <[hidden email]> wrote:
On Tuesday 21 July 2009 16:53:52 Linux Addict wrote:
>
> I tried using transport maps,  "example.com      :[smtp1.example.com]"
> and " example.com   smtp:[smtp1.example.com], but of them didn't use
> smtp.example.com.

Not clear what you mean here.

Documentation of "transport" (man transport) suggests you don't want the "[]"
if you want MX lookup.

So I think you want:

example.com smtp:smtp.example.com

Simon, I already tried that. Its not doing MX lookup I guess.

Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Clunk Werclick
In reply to this post by Clunk Werclick
On Tue, 2009-07-21 at 17:10 +0100, Clunk Werclick wrote:

> On Tue, 2009-07-21 at 12:05 -0400, Linux Addict wrote:
> >
> >
> > On Tue, Jul 21, 2009 at 12:00 PM, Ralf Hildebrandt
> > <[hidden email]> wrote:
> >         * Ralf Hildebrandt <[hidden email]>:
> >        
> >         > > In simple, When I send a mail to @example.com,  postfix
> >         must send the mail
> >         > > to the MX records of smtp.example.com.
> >        
> >        
> >         > example.com      smtp.example.com
> >        
> >        
> >         OK, not too sure if Postfix will perform an MX lookup for the
> >         RHS
> >         (smtp.example.com in this example). Please try
> >        
> >        
> >         --
> >         Ralf Hildebrandt
> >          Geschäftsbereich IT | Abteilung Netzwerk
> >          Charité - Universitätsmedizin Berlin
> >          Campus Benjamin Franklin
> >          Hindenburgdamm 30 | D-12203 Berlin
> >          Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
> >          [hidden email] | http://www.charite.de
> >        
> >        
> >
> > I just tried, Its NOT  using MX records of smtp.example.com. I can
> > manipulate it thru DNS, but will more comfortable if we can do it
> > through Postfix.
> >
> >
> >
> What about plain old:
>
> smtp:
>
> and nothing else. I was trying to day to do the opposite but it kept
> looking up the mx for the destination domain when I did not have a
> transport map.
Don't listen to me - I am an idiot. I have now read your request fully
and I am garbage spouting. Sorry.
--
-----------------------------------------------------------
C Werclick .Lot
Technical incompetent
Loyal Order Of The Teapot.

This e-mail and its attachments is intended only to be used as an e-mail
and an attachment. Any use of it for other purposes other than as an
e-mail and an attachment will not be covered by any warranty that may or
may not form part of this e-mail and attachment.



Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Jaroslaw Grzabel
In reply to this post by Linux Addict
Linux Addict wrote:
>
> Simon, I already tried that. Its not doing MX lookup I guess.
>
Maybe it works but you're using your local DNS which doesn't know MX
record for that remote domain you want to relay your messages through.
Try locally run dig domainname.com MX and see the result. If it's empty
it means that it's something wrong with that domain name and there is
nothing to do with postfix in this case because postfix will not cast a
spell for you and charm MX record.

syntax as:
domainname.com smtp:server.domain.com
should work for you

Regards,
Jarek

P.S. Sorry I posted that to your priv as well... reply to the list please.
Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Linux Addict
I tried digging, I get the MX servers on the ANSWER section. I manage DNS as well, so I know its resolving correctly.

On Tue, Jul 21, 2009 at 12:20 PM, Jaroslaw Grzabel <[hidden email]> wrote:
Linux Addict wrote:

Simon, I already tried that. Its not doing MX lookup I guess.

Maybe it works but you're using your local DNS which doesn't know MX record for that remote domain you want to relay your messages through. Try locally run dig domainname.com MX and see the result. If it's empty it means that it's something wrong with that domain name and there is nothing to do with postfix in this case because postfix will not cast a spell for you and charm MX record.

syntax as:
domainname.com smtp:server.domain.com
should work for you

Regards,
Jarek

P.S. Sorry I posted that to your priv as well... reply to the list please.

Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Jaroslaw Grzabel
Linux Addict wrote:
> I tried digging, I get the MX servers on the ANSWER section. I manage
> DNS as well, so I know its resolving correctly.
What is in the log files then when you're trying to relay your messages ?

Regards,
Jarek
Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Linux Addict


On Tue, Jul 21, 2009 at 12:24 PM, Jaroslaw Grzabel <[hidden email]> wrote:
Linux Addict wrote:
I tried digging, I get the MX servers on the ANSWER section. I manage DNS as well, so I know its resolving correctly.
What is in the log files then when you're trying to relay your messages ?

Regards,
Jarek

Good Question.  It is using the MX records of  example.com, but we need postfix to use the MX records of smtp.example.com


Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Linux Addict


On Tue, Jul 21, 2009 at 12:37 PM, Linux Addict <[hidden email]> wrote:


On Tue, Jul 21, 2009 at 12:24 PM, Jaroslaw Grzabel <[hidden email]> wrote:
Linux Addict wrote:
I tried digging, I get the MX servers on the ANSWER section. I manage DNS as well, so I know its resolving correctly.
What is in the log files then when you're trying to relay your messages ?

Regards,
Jarek

Good Question.  It is using the MX records of  example.com, but we need postfix to use the MX records of smtp.example.com



Thanks all. I just worked around by adding internal CNAME pointing to 2 MX servers. I will come back later and check
Reply | Threaded
Open this post in threaded view
|

Re: Transport Maps

Clunk Werclick
In reply to this post by Linux Addict
On Tue, 2009-07-21 at 12:21 -0400, Linux Addict wrote:
> I tried digging, I get the MX servers on the ANSWER section. I manage
> DNS as well, so I know its resolving correctly.

Just one thing Sir and a shot in the water. Restart Postfix (not
reload). I was having a problem where it kept looking up against the
wrong name server. There seems to be some caching of name servers and
results.

After many hours it gave me such joy for a simplest fix.

--
-----------------------------------------------------------
C Werclick .Lot
Technical incompetent
Loyal Order Of The Teapot.

This e-mail and its attachments is intended only to be used as an e-mail
and an attachment. Any use of it for other purposes other than as an
e-mail and an attachment will not be covered by any warranty that may or
may not form part of this e-mail and attachment.



Reply | Threaded
Open this post in threaded view
|

Alternate mail server in transport table?

Curtis-20
In reply to this post by Ralf Hildebrandt
I run a spam filtering service where the customer points the MX records to our mail servers and then we forward the filtered mail on to the destination using the transport table, as follows:

customer.com smtp:[mailserver1.customer.com]

Today I got a request from a potential customer asking if it is possible to specify a secondary mail server, to be used only if their primary mail server is down.  I don't see a way to do this using the transport table... perhaps there's another way?  Anyone have any ideas for me?

Thanks,

Curtis

Reply | Threaded
Open this post in threaded view
|

Re: Alternate mail server in transport table?

Noel Jones-2
On 10/23/2009 9:42 AM, Curtis wrote:

> I run a spam filtering service where the customer points the MX records to our mail servers and then we forward the filtered mail on to the destination using the transport table, as follows:
>
> customer.com smtp:[mailserver1.customer.com]
>
> Today I got a request from a potential customer asking if it is possible to specify a secondary mail server, to be used only if their primary mail server is down.  I don't see a way to do this using the transport table... perhaps there's another way?  Anyone have any ideas for me?
>
> Thanks,
>
> Curtis
>

Postfix does not support multiple next-hops in the transport
table.  That's what MX records are for.

Add local entries to your DNS something like
   customer.local  MX 10 ip.1
   customer.local  MX 20 ip.2
and use a transport entry like
customer.com smtp:customer.local
note: no "[ ]" so MX will be used!!



An alternative is to define a new transport in master.cf with
a -o fallback_relay=[some.ip.addr.ess], but that gets messy if
there are more than a few domains needing fallback.
# transport
customer.com  customer:[ip.1]

# master.cf
# this is a copy of the "smtp ... smtp" entry
customer ... smtp
   -o fallback_relay=[ip.2]


   -- Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: Alternate mail server in transport table?

Curtis-20
On Fri, Oct 23, 2009 at 8:59 AM, Noel Jones <[hidden email]> wrote:
On 10/23/2009 9:42 AM, Curtis wrote:
I run a spam filtering service where the customer points the MX records to our mail servers and then we forward the filtered mail on to the destination using the transport table, as follows:

customer.com smtp:[mailserver1.customer.com]

Today I got a request from a potential customer asking if it is possible to specify a secondary mail server, to be used only if their primary mail server is down.  I don't see a way to do this using the transport table... perhaps there's another way?  Anyone have any ideas for me?

Thanks,

Curtis


Postfix does not support multiple next-hops in the transport table.  That's what MX records are for.

Add local entries to your DNS something like
 customer.local  MX 10 ip.1
 customer.local  MX 20 ip.2
and use a transport entry like
customer.com smtp:customer.local
note: no "[ ]" so MX will be used!!

Perfect!  I don't know how long it would have taken for me to think of this solution... it's just what I needed.  

Curtis
 



An alternative is to define a new transport in master.cf with a -o fallback_relay=[some.ip.addr.ess], but that gets messy if there are more than a few domains needing fallback.
# transport
customer.com  customer:[ip.1]

# master.cf
# this is a copy of the "smtp ... smtp" entry
customer ... smtp
 -o fallback_relay=[ip.2]


 -- Noel Jones