Problem
Can I use BackupMX to help with migration of a primary email server?
How to use BackupMX to assist with mail flow during a migration of the primary SMTP server?
Scenario 1:
In this scenrio you currently only have one mail server. You want to migrate to another server but your worried that during the migration all emails will get bounced, rejected or fail completely.
Can backupMX help you with this scenario? Yes it can.
Background Information
Before we continue, lets discuss briefly what backupMX is and how it works. BackupMX (also known as backup mx, backup SMTP or secondary SMTP) is a mail server that works as a secondary mail server to the primary. It will accept emails on behalf of a specified domain name and then attempt to deliver them to the primary server as listed in the priority order of the DNS MX records. When the primary goes offline then backupMX will continue to accept emails for that domain and keep them queued until such times the primary is available again.
In this scenario we have a domain example.com with one mail server (mailserver.example.com).
Let's look at the current DNS (Domain Name Service) MX (Mail eXchange) records for our domain.
example.com IN MX 10 mailserver.example.com.
Step one
Before we start any migration work of the primary server, let's add in backupMX.
Sign up for a backupMX service and configure for the domain name, in this case example.com.
We need to change the DNS MX records accordingly.
example.com IN MX 10 mailserver.example.com.
example.com IN MX 20 mxXXXXXX.smtp-engine.com.
So now emails can be serviced by either server, and any emails backupMX receives will then be delivered to the primary server.
Note:
At this point; It would be advisable to change the TTL (Time To Live) on the changing records to something low, otherwise you could be waiting for DNS changes to ripple out over the Internet. Somewhere between 10 and 15 mins should do it, but remember to change back after the migration.
Step two
Remember, backupMX will always try and deliver whatever is on its mail queue to the primary server (i.e. the MX record with the highest priority). So before we remove the server from DNS MX records we need something to go in its place.
So, let's create a pretend/fake mail server record in DNS. This keeps backupMX happy because it knows there is a primary server (our fake server) to attempt to deliver emails to, but because it's a fake server backupMX thinks its offline and then simply queues up the emails.
Let's change DNS.
fakeserver.example.com IN A 10.0.0.1
example.com IN MX 10 fakeserver.example.com.
example.com IN MX 20 mxXXXXXX.smtp-engine.com.
Notice above we have created an A record and changed the primary MX record. We must create the A record because MX records need to point to hostnames. In that A record (fakeserver) we have given it an IP address that no mail server would be listening on. You can use a private or public IP address as long as it's owned by you and no mail server is listening on tcp port 25.
Note:
If you simply just removed the primary MX leaving only backupMX in the MX list all emails would fail. This is because you have technically made backupMX the primary server as its now the highest priority MX server. backupMX isn't configured as a primary mailserver and therefore emails would be bounced as it has nowhere else to deliver them to.Step Three
Introduce the new primary mailserver and change DNS.
example.com IN MX 10 newserver.example.com.
example.com IN MX 20 mxXXXXXX.smtp-engine.com.
Soon after the DNS change (determined by the TTL values) backupMX will see the new server as online and all queued emails will get delivered.
Step Four
Once the migration is complete and once you're happy the mail queue has cleared then you could remove backupMX from the DNS MX list, but why?
Keeping backupMX in place is what its designed for. A backup SMTP server to accept emails for your domain when the primary goes offline.
Additional Comments.
Not really.
In this scenario we are migrating from one "live and online" server to another. So we need an element of time for the original primary server to not receive emails anymore for example.com, because that original server will remain online we need to introduce a fake mail server so that no emails can go to the primary and backupMX will accept emails instead.
BackupMX is designed to keep emails queued for 7 days, trying to deliver to the primary server. After those 7 days emails will start to bounce.
However, if you think you will need more than 7 days then please contact support as this can be extended.