We are starting CHRISTMAS Sale. Get 30% OFF on lifetime licenses with code: FYSKK72

Secondary MX Topic is solved

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
SS88
Posts: 298
Joined: Thu Nov 19, 2015 12:40 pm

Secondary MX

Postby SS88 » Wed Apr 13, 2016 5:59 pm

Hello.

Has anyone got this working? I wouldn't called it Mail Clustering but if MX 1 goes offline, MX 2 takes over and accepts the e-mails until MX 1 is back online. Once it's back online it delivers them.

Anyone have experience with this?

Spheerys
Posts: 126
Joined: Tue Dec 29, 2015 12:36 pm

Re: Secondary MX

Postby Spheerys » Wed Apr 13, 2016 7:06 pm

I'm interested too !

mehargags
Moderators
Posts: 832
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: Secondary MX

Postby mehargags » Wed Apr 13, 2016 7:11 pm

This indeed is "clustering" so that the servers sync up the data (mails) with each other. If one server goes down the other is taking in the "calls" for incoming and outgoing. This is not supported in VestaCP yet (to my best guess) but you can setup secondary MX using some guides on internet

SS88
Posts: 298
Joined: Thu Nov 19, 2015 12:40 pm

Re: Secondary MX

Postby SS88 » Wed Apr 13, 2016 7:12 pm

I've found it out! :)

I'll post soon.

SS88
Posts: 298
Joined: Thu Nov 19, 2015 12:40 pm

Re: Secondary MX

Postby SS88 » Wed Apr 13, 2016 7:13 pm

mehargags wrote:This indeed is "clustering" so that the servers sync up the data (mails) with each other. If one server goes down the other is taking in the "calls" for incoming and outgoing. This is not supported in VestaCP yet (to my best guess) but you can setup secondary MX using some guides on internet



Yes, my solution that I have working is a relay. So users cannot connect to MX2 to send / receive but MX2 will send e-mails back to MX1 when it's back online.

SS88
Posts: 298
Joined: Thu Nov 19, 2015 12:40 pm

Re: Secondary MX  Topic is solved

Postby SS88 » Wed Apr 13, 2016 7:36 pm

Okay soo...

I'm on Debian so the paths are correct for me, usually different for others.

  • First set-up the second server (can be a separate install of Vesta or just a stripped down version) with VestaCP. Make sure it's got Exim installed.
  • Create a file /etc/exim4/mx_domains on the second server and populate it with the domains separated by a new line you it to accept mail for. (i.e. yourdomain.com)
  • Change the file /etc/exim4/exim4.conf.template and find the line domainlist relay_to_domains = dsearch;/etc/exim4/domains/ and change it to: domainlist relay_to_domains = dsearch;/etc/exim4/domains/ : lsearch;/etc/exim4/mx_domains
  • Restart Exim.
  • Go to https://www.wormly.com/test_smtp_server and send a test email (i.e. email@yourdomain.com). Make sure the SMTP Server field is the IP address of your second VestaCP server.
  • It should report it's been accepted, and then after a short while you should receive the test e-mail to your main mail server.
  • If testing succeeded and you receive the e-mail you can now set-up the second MX record with a higher priority (i.e. 20). When MX1 is offline, MX2 will receive the e-mails. When MX1 is back online, MX2 will send the emails to MX1.

raenk
Posts: 3
Joined: Mon Sep 15, 2014 12:16 am

Re: Secondary MX

Postby raenk » Sat Jul 09, 2016 6:00 am

Got it working making sure the domains aren't setup for mail support on secondary servers. Domains shouldn't exist in /etc/exim/domains

TopCoder
Posts: 4
Joined: Mon Jul 11, 2016 12:22 am

Re: Secondary MX

Postby TopCoder » Mon Jul 11, 2016 12:34 am

If testing succeeded and you receive the e-mail you can now set-up the second MX record with a higher priority (i.e. 20). When MX1 is offline, MX2 will receive the e-mails. When MX1 is back online, MX2 will send the emails to MX1.


Mail will go to the second one, if the first one gets too busy also. Doesn't have to be offline, if it doesn't respond the second one will be tried, before the sending MTA retries at a different time.


Return to “Mail Server”



Who is online

Users browsing this forum: No registered users and 4 guests