Re: Secondary outbound mail on Postfix

242 views
Skip to first unread message

Wietse Venema

unread,
Mar 30, 2015, 7:19:11 AM3/30/15
to
Sedhumadhavan Parthasarathy1:
> Hi All,
>
> Our primary outbound mail is configured in postfix MTA. We would like to
> set a secondary outbound mail server on DR sitee.

With all Postfix versions, you would set relayhost to a name that
resolves to multiple IP addresses (in DNS or /etc/hosts). In my
first 10+ years in IBM I had:

relayhost = $mydomain

i.e. use the MX records for the local domain.

Later I had to change that to

relayhost = [na.relay.ibm.com]

i.e. use the A records for a regional mail cluster.

> Will it possible to configure secondary outbound mail server on Postfix ?
> Postfix will have high availability functionality ?

Having multiple servers helps.

With Postfix 3.0.0 you could use this:

sender_dependent_relayhost_maps = randmap:{[host1], [host2]}

You could even list host1 and host2 different numbers of times
to get a load split different from 50/50.

Wietse
>
> Cheers...
>
>
>
> Sedhumadhavan (Sedhu) Parthasarathy
>
>
> Infrastructure Architect
>
> IBM Certified Infrastructure Systems Architect
> IBM Certified Cloud Computing Infrastructure Solution Architect
> Client Excellence - Change and Innovation
>
> Delivery Centre India, GTS Services Delivery
>
> Desk Phone:
> +91 044-43420599
>
> Hand Phone:
> +91 9791015169
>
> e-mail:
> sedp...@in.ibm.com
>
>
> Address:
> DLF IT PARK,Tower 1A 1F A034,Chennai 89,TamilNadu,INDIA
>
>
> People with highly successful careers constantly learn and develop their
> skills
> Vacation Plan : I will be out of the office from 4th May to 8th May
>
>

[ image/gif is not supported, skipping... ]

sedhumadhavan Parthasarathy

unread,
Mar 30, 2015, 7:46:23 AM3/30/15
to
On Monday, March 30, 2015 at 4:49:11 PM UTC+5:30, Wietse Venema wrote:
> Sedhumadhavan Parthasarathy1:
> > Hi All,
> >
> > Our primary outbound mail is configured in postfix MTA. We would like to
> > set a secondary outbound mail server on DR sitee.
>
> With all Postfix versions, you would set relayhost to a name that
> resolves to multiple IP addresses (in DNS or /etc/hosts). In my
> first 10+ years in IBM I had:
>
> relayhost = $mydomain
>
> i.e. use the MX records for the local domain.
>
> Later I had to change that to
>
> relayhost = [na.relay.ibm.com]
>
> i.e. use the A records for a regional mail cluster.
>
> > Will it possible to configure secondary outbound mail server on Postfix ?
> > Postfix will have high availability functionality ?
>
> Having multiple servers helps.
>
> With Postfix 3.0.0 you could use this:
>
> sender_dependent_relayhost_maps = randmap:{[host1], [host2]}
>
> You could even list host1 and host2 different numbers of times
> to get a load split different from 50/50.
>
> Wietse
> >
> > Cheers...
> >
> >
> >
> > Sedhu


Thanks Wietse, Do you have any link or reference documents to guide to set up secondary outbound mail server on DR site ?

Here is our primary server configuration file :

alias_database = dbm:/etc/postfix/aliases
alias_maps = dbm:/etc/postfix/aliases
canonical_maps = dbm:/etc/postfix/canon
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
disable_dns_lookups = no
html_directory = /usr/share/doc/postfix-2.2.8/html
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/sbin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = warwick.meb.ihost.com
myhostname = gb02.warwick.meb.ihost.com
mynetworks = xx.xx.xx.xx/16, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/sbin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES
relay_domains = $mydestination online.deb.com
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_host_lookup = native,dns
smtpd_recipient_restrictions = permit_mynetworks,check_relay_domains,reject_unauth_destination
transport_maps = dbm:/etc/postfix/transport
unknown_local_recipient_reject_code = 550

Viktor Dukhovni

unread,
Mar 30, 2015, 1:52:53 PM3/30/15
to
On Mon, Mar 30, 2015 at 07:18:52AM -0400, Wietse Venema wrote:
> Sedhumadhavan Parthasarathy1:
> > Hi All,
> >
> > Our primary outbound mail is configured in postfix MTA. We would like to
> > set a secondary outbound mail server on DR sitee.
>
> With all Postfix versions, you would set relayhost to a name that
> resolves to multiple IP addresses (in DNS or /etc/hosts). In my
> first 10+ years in IBM I had:
>
> relayhost = $mydomain

I'd go with a variant of that:

relayhost = outbound.$mydomain

and configure MX records for that name in the internal DNS:

outbound IN MX 0 primary
outbound IN MX 10 secondary
primary IN A 192.0.2.1
secondary IN A 192.0.2.2

mail will go to the primary first, and only if the primary is down
or defers the transaction with a 4XX code will it go to the secondary.

--
Viktor.

Wietse Venema

unread,
Mar 30, 2015, 3:45:09 PM3/30/15
to
Sedhumadhavan Parthasarathy1:
> Hi All,
>
> Our primary outbound mail is configured in postfix MTA. We would like to
> set a secondary outbound mail server on DR sitee.

Are you asking

- How to configure Postfix to BE the second outbound relay?

- How to configure Postfix to USE a second outbound relay?

Wietse

Zoltán Beck

unread,
Feb 5, 2022, 6:30:31 PM2/5/22
to
Hi,

may I ask if there is an answer for the second question? How can I set up postfix to relay e-mails through one of the available relay hosts? If the first one is not available, then send to second one relay host.

Kind Regards,
Zoltan
Reply all
Reply to author
Forward
0 new messages