nunixo

Registered
Jun 16, 2004
4
0
151
Hi there,

we have a cpanel server where we have our main domain, and some of our customers domains. And we have a second server with cpanel too that host more customers. We want to setup the second server as secondary mx for some accounts hosted on the first server.

Can someone please tell me if this is possible and how can this be done?
 

gupi

Well-Known Member
Apr 27, 2004
125
0
166
1) In /etc/secondarymx file on the second server, add the domains you need to have secondary MX, one at a line
2) in DNS records of the desired domains, add stating something like this:
example.com. IN MX 10 secondserver.yourdomain.com.
 

Lyttek

Well-Known Member
Jan 2, 2004
776
4
168
And as a helpful side note... that question would have been answered about 10 times by using the search function ;)
 

Wallaby

Well-Known Member
Aug 15, 2001
131
1
318
All a secondary mailserver does is store mail that cannot be delivered to the primary, until such time as it can forward it back to the primary server.

If you want 2 mailservers each with all the email accounts and so on set up, you need to do the setup manually, and also (I believe -- check this) have the two MX records set to the same priority in the DNS. You would not really want to do this though. Even a conventional secondary MX is of limited value, as if your mailserver is down the sending server will keep retrying, for up to 5 days usually.
 

SoftDux

Well-Known Member
May 27, 2006
1,024
5
168
Johannesburg, South Africa
cPanel Access Level
Root Administrator
All a secondary mailserver does is store mail that cannot be delivered to the primary, until such time as it can forward it back to the primary server.

If you want 2 mailservers each with all the email accounts and so on set up, you need to do the setup manually, and also (I believe -- check this) have the two MX records set to the same priority in the DNS. You would not really want to do this though. Even a conventional secondary MX is of limited value, as if your mailserver is down the sending server will keep retrying, for up to 5 days usually.
Ok, but how does the secondary mailserver know which mail goes where?
 

lostinspace

Well-Known Member
Jul 19, 2003
122
1
168
Colorado Springs, CO
Ok, but how does the secondary mailserver know which mail goes where?
The secondary server does nothing with routing other than store the messages for later delivery.

For example:
domain.com set up with 2 MX records.
mx1.domain.com
mx2.domain.com

mx1 hosts domain.com and mx2 is a backup (priorities are 0 & 10 respectively).

So assume mx1 goes down...

Any sending mail servers attempt a connection with mx1 (based on the DNS MX record and priority - in this example "0"), when there is no response, the sending mail server looks for the next highest mx priority, in this case, mx2 (priority "10"). mx2's "/etc/secondarymx" file tells mx2 that even though the domain is not hosted locally, it should queue the message for later delivery to mx1. The message will not be routed to any inboxes locally on mx2 (i.e, you won't be able to log into mx2 and check the e-mail for any domains in the "/etc/secondarymx" file). mx2 will poll mx1 and once mx1 responds, mx2 will deliver the messages intended for mx1's local domains.

All a secondary mail server does is prevent bounced messages after the 5 days or so. Of course it also prevents you from loosing important messages should you suffer an extended outage. Although, if your primary server is down for more than 5 days you'll probably have bigger issues by then - heh.

You might be looking for a mail forwarding service (something that delivers a copy of email to a whole separate server for local delivery. This is a whole different ball game. Check out some of the third party DNS services out there for mail forwarding.

From http://www.zoneedit.com/:
Backup Mail Service new! - Want to run your own mail server, but you're afraid of missing important e-mails? Our optional "Store and Forward" service will accept e-mails for you while your mail server is down or unavailable, and redeliver them when you're back up!
Of course such a great service is not free.
 
Last edited: