What is Backup Mailserver / Secondary Mailserver ?
When your mail server is not accessible by others you have a chance of losing valuable emails. These lost emails can result in lost sales and loss revenue. You can prevent this today by using Backup Mail Service/ Secondary Mailserver.
How it works:
When an email is sent to a recipient the email server looks to see which server handles mail for the domain using the DNS MX records. MX records specify which server(s) will receive mail for a given domain. Each MX record is given a priority (the MX level), the lowest being the primary mail server. The primary mail server is responsible for delivering the mail to the appropriate user mailbox.
Mail delivery is first attempted to be delivered to the primary mail server (the mail server indicated by the MX record with the lowest numbered MX level). If that server is not reachable then the mail will be attempted to be delivered to the mail server with the second lowest MX level. If the second lowest mail server in priority can not be reached then the mail will be delivered to the mail server with the third lowest mx level (third lowest priority) and so on.
If no mail servers can be reached then mail is sometimes queued but is usually just bounced back to the sender. This can lead to lost sales and lost revenue and worst of all lost of communication and respect.
First we need to have a MX record for primary and secondary in DNS servers
Example :
[code]testing.com MX 0 testing.com
testing.com MX 20 dev.testing.com[/code]
I assume we already have testing.com (primary mailserver) up and running without any problem.
In this case, we don't need to touch anything in primary mailserver.
primary and secondary mailserver is running centos OS
Next we just need to configure dev.testing.com (secondary mailserver)
Configure Secondary Mailserver (dev.testing.com)
Login into dev.testing.com with root access
We will need to install mailserver. example ; POSTFIX
[code]$yum install postfix*[/code]
Configure postfix
[code]$cd /etc/postfix[/code]
Edit "access" file
[code]$pico access
### added 1 line below
testing.com OK
### save this file[/code]
Edit "main.cf" file
[code]$pico main.cf
### edit variable below to suit your need
myhostname = dev.testing.com
mydestination = $myhostname, localhost.$mydomain, localhost, testing.com
transport_maps = hash:/etc/postfix/transport
### save this file[/code]
Edit "transport" file
[code]$pico transport
### added 1 line below
testing.com smtp:testing.com
### save this file[/code]
Edit "virtual" file
[code]$pico virtual
### added 1 line below
testing.com testing.com relay
### save this file[/code]
Testing out the secondary mailserver
Login with root access into primary mailserver (testing.com)
Shutdown primary mailserver
[code]$service sendmail stop or service postfix stop[/code]
Open 1 session with putty for secondary mailserver (dev.testing.com)
View maillog with tail
[code]$tail -f /var/log/maillog
### you will see something like below
### primary mx down, secondary mx will take incoming email in queue
.....................
Mar 23 01:29:46 dev postfix/cleanup[11711]: 31EDA3D70C9: message-id=<20080323082918.31EDA3D70C9@dev.testing.com>
Mar 23 01:29:46 dev postfix/qmgr[11702]: 31EDA3D70C9: from=<sentono@gmail.com>, size=403, nrcpt=1 (queue active)
-------------------[/code]
Go to primary mailserver and start a mail server again
[code]$service sendmail start or service postfix start[/code]
Go to secondary mailserver and flush queue in secondary mail server with this command
[code]$/etc/init.d/postfix flush[/code]
Take a look in maillog with tail again in secondary mailserver
[code]$tail -f /var/log/maillog
### you will see email queue from sentono@gmail.com will automatically transfer to primary mailserver
### email in queue will automatically removed from secondary mailserver
Mar 23 01:29:46 dev postfix/smtp[11712]: 31EDA3D70C9: to=<sentono@testing.com>, relay=testing.com[10.10.1.1]:25, delay=33, delays=33/0.08/0.03/0.02, dsn=2.0.0, status=sent (250 2.0.0 m2N8Tltl002047 Message accepted for delivery)
Mar 23 01:29:46 dev postfix/qmgr[11702]: 31EDA3D70C9: removed
------------------[/code]
Then, you can accept email with outlook as usual with send/receive button.
email from sentono@gmail.com will automatically received in sentono@testing.com mailbox.
IMPORTANT : you need to have sentono@testing.com mailbox in your secondary mailserver to handle all email queue or it will automatically rejected.
ShareThis
Recent comments
6 days 9 hours ago
3 weeks 6 days ago
4 weeks 5 days ago
4 weeks 6 days ago
5 weeks 7 hours ago
5 weeks 7 hours ago
5 weeks 1 day ago
5 weeks 1 day ago
5 weeks 4 days ago
6 weeks 12 hours ago