secondary (backup) mx relay

synergy

Verified User
Joined
Nov 8, 2003
Messages
48
Location
Australia
A client is taking their mail server off line for 24 hours to move the server. They would like a secondary MX record on a different server (which runs DA) to hold the mail and deliver it when the primary server is back online.

I would like to change the DA server exim.conf file like this:

relay_domains = primaryserver.com

which will queue the requests and deliver them when the primary server comes back on.

My question is: where do I add this? In other words will DA overwrite the /etc/exim.conf file the next time it updates? Do I need to put this in the /usr/local/directadmin/data/templates/custom directory instead?

Thanks.
 
Hello,

DA does not touch your exim.conf so you are safe to make any changes without worry.

You'd make your relay_domains line look like:

domainlist relay_domains = lsearch;/etc/virtual/domains : \
localhost : primaryserver.com

John
 
I had to setup a few domains today requiring remote primary MX and local secondary MX. I did it a slightly different way so I'll post it here .

1) with pico or vi, create a file called relay-hosts in /etc/virtual
List the domains you want to be secondary MX for (one per line).
Change owner and group of the file to to mail.mail

2) Edit /etc/exim.conf

Change this:

domainlist relay_domains = lsearch;/etc/virtual/domains : \
localhost

To this :

domainlist relay_domains = lsearch;/etc/virtual/domains : lsearch;/etc/virtual/relay-hosts : \
localhost

Save and reload or restart exim , service exim reload

A little warning:
If the domain you are providing secondary MX service for, is a user's domain on the same server....

It is important to un-tick the box "use this server to process mail for this domain " located in the "Change MX" section of the user's control panel.

This will un-list the domain from /etc/virtual/domains So emailed generated localy (website form processing, emails sent via webmails etc..) are forwarded to the remote primary MX and not processed locally and bounced.

Miky
 
Miky said:
I had to setup a few domains today requiring remote primary MX and local secondary MX. I did it a slightly different way so I'll post it here .
Good job, Miky. What do you mean by a slightly different way? What other ways are other people doing it? Can you direct us to some examples and explain why you did it your way, so we can all learn?
1) with pico or vi, create a file called relay-hosts in /etc/virtual
List the domains you want to be secondary MX for (one per line).
Change owner and group of the file to to mail.mail
I might have used a different file name since relay-hosts is so similar to relay_hosts, which is used by exim for a different purpose. Might I recommend secondary_mx_domains ?
2) Edit /etc/exim.conf

Change this:

domainlist relay_domains = lsearch;/etc/virtual/domains : \
localhost

To this :

domainlist relay_domains = lsearch;/etc/virtual/domains : lsearch;/etc/virtual/relay-hosts : \
localhost
If anyone should make the filename change I've suggested be sure to change relay-hosts to secondary_mx_domains in the line above.
Save and reload or restart exim , service exim reload

A little warning:
If the domain you are providing secondary MX service for, is a user's domain on the same server....

It is important to un-tick the box "use this server to process mail for this domain " located in the "Change MX" section of the user's control panel.

This will un-list the domain from /etc/virtual/domains So emailed generated localy (website form processing, emails sent via webmails etc..) are forwarded to the remote primary MX and not processed locally and bounced.
Please let us know how this works for you, Miky.

Thanks.

Jeff
 
jlasman said:
Good job, Miky. What do you mean by a slightly different way? What other ways are other people doing it? Can you direct us to some examples and explain why you did it your way, so we can all learn?

Reading this unique post if they are lucky enough to find it, and calling for help because they reached the end of the line and have an other domain to add in the list :confused: Or wondering why webform results never turn up.

I might have used a different file name since relay-hosts is so similar to relay_hosts, which is used by exim for a different purpose. Might I recommend secondary_mx_domains ?

Yes it would probably make more sence since it's mainly what it's for. relay_domains might be an obvious one too. I've never been too good at taking those types of decisions :)


Please let us know how this works for you, Miky.

Been working fine , the following issue was adding an ETRN access list in exim.conf . I'll check if anyone posted something about it , if not i'll post mine here.

Miky
 
Back
Top