Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

multiple relay hosts in transport - syntax

985 views
Skip to first unread message

Andrew Long

unread,
Aug 4, 2009, 8:13:48 AM8/4/09
to
I would like to define two relay hosts for one domain in our transport
map, the primary and backup MTX so postfix will try the backup if the
primary does not respond. Is this possible and what would be my
syntax?

domain.com smtp:[pri-mx.domain.com] smtp:[bak-mx.domain.com]
or
domain.com smtp:[pri-mx.domain.com] [bak-mx.domain.com]

or wrong all together...\

Thank you.

Ralf Hildebrandt

unread,
Aug 4, 2009, 8:15:14 AM8/4/09
to
* Andrew Long <fur...@gmail.com>:

> I would like to define two relay hosts for one domain in our transport
> map, the primary and backup MTX so postfix will try the backup if the
> primary does not respond. Is this possible and what would be my
> syntax?

Use dns
like:

$ host -t mx charite.de
charite.de mail is handled by 120 mail.charite.de.
charite.de mail is handled by 110 mail-ausfall.charite.de.

and then use:

domain.de charite.de

--
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
ralf.hil...@charite.de | http://www.charite.de

Andrew Long

unread,
Aug 4, 2009, 8:32:01 AM8/4/09
to
> $ host -t mx charite.de
> charite.de mail is handled by 120 mail.charite.de.
> charite.de mail is handled by 110 mail-ausfall.charite.de.
>
> and then use:
>
> domain.de =C2=A0 charite.de

I'm afraid I'm not quite clear on this. They're are two mx's in the
dns for the domain, a la

$ host -t mx domain.com
domain.com mail is handled by 20 domain.com.bak-mx.smtpblah.com.
domain.com mail is handled by 10 domain.com.pri-mx.smtpblah.com.

so my transport would look like... what?

Ralf Hildebrandt

unread,
Aug 4, 2009, 8:36:32 AM8/4/09
to
* Andrew Long <fur...@gmail.com>:

> > $ host -t mx charite.de
> > charite.de mail is handled by 120 mail.charite.de.
> > charite.de mail is handled by 110 mail-ausfall.charite.de.
> >
> > and then use:
> >
> > domain.de   charite.de

>
> I'm afraid I'm not quite clear on this. They're are two mx's in the
> dns for the domain, a la
>
> $ host -t mx domain.com
> domain.com mail is handled by 20 domain.com.bak-mx.smtpblah.com.
> domain.com mail is handled by 10 domain.com.pri-mx.smtpblah.com.
>
> so my transport would look like... what?

domain.com domain.com

Sahil Tandon

unread,
Aug 4, 2009, 8:37:48 AM8/4/09
to
On Aug 4, 2009, at 8:31 AM, Andrew Long <fur...@gmail.com> wrote:

>> $ host -t mx charite.de
>> charite.de mail is handled by 120 mail.charite.de.
>> charite.de mail is handled by 110 mail-ausfall.charite.de.
>>
>> and then use:
>>
>> domain.de charite.de
>
> I'm afraid I'm not quite clear on this. They're are two mx's in the
> dns for the domain, a la
>
> $ host -t mx domain.com
> domain.com mail is handled by 20 domain.com.bak-mx.smtpblah.com.
> domain.com mail is handled by 10 domain.com.pri-mx.smtpblah.com.
>
> so my transport would look like... what?

It would look like Ralf already showed you. But if you are sending to
example.org which has the two MX RRs, then there is no need to
configure transport maps. If you do use transport maps, the lack of
brackets around the nexthop means Postfix will use MX lookups when
deciding which nexthop to choose.

You CANNOT specify multiple nexthops in the sense you tried to in your
original post.

Andrew Long

unread,
Aug 4, 2009, 8:52:48 AM8/4/09
to
> It would look like Ralf already showed you. But if you are sending to
> example.org which has the two MX RRs, then there is no need to configure
> transport maps. If you do use transport maps, the lack of brackets around
> the nexthop means Postfix will use MX lookups when deciding which nexthop to
> choose.
>
> You CANNOT specify multiple nexthops in the sense you tried to in your
> original post.

Perhaps I left out a detail. There is actually a third mx in dns,
which is THIS postfix machine. Although

$ host -t mx domain.com
domain.com mail is handled by 20 domain.com.bak-mx.smtpblah.com.
domain.com mail is handled by 10 domain.com.pri-mx.smtpblah.com.

if I do an axfr it is actually:
domain.com. 3600 IN MX 10 domain.com.pri-mx.smtpblah.com.
domain.com. 3600 IN MX 20 domain.com.bak-mx.smtpblah.com.
domain.com. 3600 IN MX 90 POSTFIX.domain.com.

So I want to avoid postfix sending mail for domain.com (a valid relay
domain, actually our domain) to itself.
I am not sure why a straight host lookup did not return the third mx
when it is in dns.

If this looks strange, it is due to the fact that this MTX's primary
role is to relay mail
FROM certain hosts which are configured to use this machine as their smtp server
without using dns TO anywhere. However, I want to make sure that mail
for our domain is also passed
on properly back to one of the two mx's I mentioned, without looping
back to this
postfix. I hope that's clear...

Andrew Long

unread,
Aug 4, 2009, 12:45:18 PM8/4/09
to
I apologize if this is a dupe post, but my client was not showing my
previous post properly...

Perhaps I left out a detail. There is actually a third mx in dns,
which is THIS postfix machine. Although

$ host -t mx domain.com
domain.com mail is handled by 20 domain.com.bak-mx.smtpblah.com.
domain.com mail is handled by 10 domain.com.pri-mx.smtpblah.com.

if I do an axfr it is actually:
domain.com. 3600 IN MX 10 domain.com.pri-mx.smtpblah.com.
domain.com. 3600 IN MX 20 domain.com.bak-mx.smtpblah.com.
domain.com. 3600 IN MX 90 POSTFIX.domain.com.

So I want to avoid postfix sending mail for domain.com (a valid relay
domain, actually our domain) to itself.
I am not sure why a straight host lookup did not return the third mx

when it is in dns. (thoughts?)

If this looks strange, it is due to the fact that this MTX's primary
role is to relay mail
FROM certain hosts which are configured to use this machine as their smtp server
without using dns TO anywhere. However, I want to make sure that mail

for our domain (from ANYWHERE) is also passed


on properly back to one of the two mx's I mentioned, without looping
back to this
postfix. I hope that's clear...

alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
default_destination_recipient_limit = 20
default_process_limit = 10
disable_vrfy_command = yes
html_directory = no
local_recipient_maps =
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydomain = escapewire.com
myhostname = host.domain.com
mynetworks = 127.0.0.0/8, /etc/postfix/relay-ip
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
relay_domains = escapewire.com
relay_recipient_maps = hash:/etc/postfix/relay_recipients
relay_transport = smtp
sample_directory = /usr/share/doc/postfix-2.2.10/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_connect_timeout = 30s
smtp_helo_timeout = 60s
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_connection_count_limit = 50
smtpd_client_connection_rate_limit = 50
smtpd_client_event_limit_exceptions = 127.0.0.0/8
smtpd_client_message_rate_limit = 50
smtpd_client_recipient_rate_limit = 50
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining, permit
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = reject_non_fqdn_recipient,
reject_non_fqdn_sender, reject_unlisted_sender,
reject_invalid_hostname, reject_unknown_sender_domain,
permit_mynetworks, reject_unauth_destination, check_helo_access
hash:/etc/postfix/helo_checks, check_sender_access
hash:/etc/postfix/sender_access, check_recipient_access
hash:/etc/postfix/roleaccount, reject_rhsbl_sender
dsn.rfc-ignorant.org permit
smtpd_sender_restrictions =
unknown_local_recipient_reject_code = 550

Noel Jones

unread,
Aug 4, 2009, 12:54:40 PM8/4/09
to
Andrew Long wrote:
> I apologize if this is a dupe post, but my client was not showing my
> previous post properly...
>
> Perhaps I left out a detail. There is actually a third mx in dns,
> which is THIS postfix machine. Although
>

[gmail eats your own posts from the list as a duplicate, so
you won't see the list posting]

postfix is clever enough that it won't send mail to itself.

However, if this box is the primary MX, it won't send mail to
a secondary either; you need a transport map in this case.

Solve that problem either with split-horizon DNS, or use a
some .local domain with MX records pointing to the other hosts.

-- Noel Jones

0 new messages