How to maintain two or more email servers for the same domain?
It is quite common that for our email accounts we buy a shared hosting plan (since dedicated hosting is quite expensive). Shared hosting has a drawback that several users share a common IP address. If any one user abuses the system and sends out spam mails, the mail server IP address is blocked/blacklisted in several networks. The end result is that all accounts hosted under the same IP get blacklisted and if you send out emails from your own email accounts, your emails are rejected by most of the recipient servers due to your shared IP having a bad reputation. Thus you become a victim of mal-use by another user who is sharing the same IP address.
One solution to overcome this problem is that you buy a dedicated IP address for your own hosting account so that your IP address which is exclusively used by you only, remains always with a clean reputation. However, it is not easy to get a dedicated IP address now-a-days. Further, even if you get to buy one, it is quite expensive. A dedicated IP address may cost you $3-4 per month, which may be higher than your hosting cost itself.
So what is the way out?
Often when a shared IP address gets black listed your hosting provider gets into action and starts working towards finding the culprit user, banning their account and then trying to get the IP whitelisted in the various networks. However, this process takes time and may take anywhere from 2-10 days. During this period, you are just stranded and unable to send out emails to most of your customers and associates, thereby affecting your business badly.
This article will help you overcome this situation and find a way of sending out emails from another server during the interim period while the blacklisted IP is being sought to be whitelisted. The method I have suggested here will not impact your website hosted on the same server which has a bad IP.
Here is the Solution
Buy a second shared hosting account on another server or from another provider. Re-create all your email accounts on the second hosting account as well. For ease of use, you may create them with the same passwords as that of your email accounts on your primary hosting server.
In your local email client, such as outlook/eudera/windows live mail/mozilla thunderbird, or other, setup a new email account with configuration settings of the new mail server. The only difference here will be that for the incoming and outgoing mail server settings, instead of providing the fully qualified domain name of the new mail server such as mail.yourdomainname.com, you must provide the IP address of the new mail server. Some hosting providers may provide you with an alternate mail server address url which does not include your domain name - eg: pop.mailhostbox.com, smtp.mailhostbox.com. You may also use these as your incoming and outgoing mail servers respectively, in place of the second server's IP address.
Now, during the iterim period that your primary IP is affected, you can use your local email client to send out emails. However, all your incoming mails will still be received in your primary mail box, as your domain's DNS points to the primary mail box.
Before you start sending out emails from this new/second interim email account, you must validate to the internet world that this second mail server is also a valid mail server for your domain. How do you do this? It is very simple - in your domain's SPF record you just need to add a minor entry and you are done.
How to do this? Just open your domain's DNS management interface (provided to you by your domain service provider). Go to the TXT Record section and edit the SPF record as below:
The TXT record corresponding to SPF may look somewhat like this: "v=spf1 mx ip4:18.104.22.168 mx:mail.yourdomainname.com -all"
All you need to do is, edit it to add an additional entry, viz. the IP address of your second mail server. Say the IP address of your second mail server is 201.299.129.120, your edited SPF record will become - "v=spf1 mx ip4: 22.214.171.124 mx:mail.yourdomainname.com ip4:201.299.129.120 -all"
After editing the SPF record, allow for at least 4 hours for propagation of DNS changes and now you are ready to send out mails from the second mail server. Note that once you have included your second mail server in your SPF record, any email that you send out from the second mail server will also be treated as genuine and not marked as spam by the recipient mail servers.
There are two other situations as well when you feel the need to maintain more than one email server for your domain. These are:
Your email accounts and website are hosted on different servers You have hosted your website on one server and your email accounts on another server. Now while most of your emails you are sending from your email server, at times you may also be sending out program generated emails from your website server via contact form-to-email applications or similar such applications. Thus you essentially have two mail servers sending out emails on behalf of your domain.
Your email send/receive limits on shared hosting are too less to cater to your bulk mailing requirements. In such a situation, you may have purchased an additional bulk mail service for one of your email accounts for sending out mass emails to your customers or newsletter subscribers.
Rajeev Kumar is the primary author of How2Lab. He is a B.Tech. from IIT Kanpur with several years of experience in IT education and Software development. He has taught a wide spectrum of people including fresh young talents, students of premier engineering colleges & management institutes, and IT professionals.
Rajeev has founded Computer Solutions & Web Services Worldwide. He has hands-on experience of building variety of websites and business applications, that include - SaaS based erp & e-commerce systems, and cloud deployed operations management software for health-care, manufacturing and other industries.