We recently configured a clustered mail server setup and webmail for one of our clients using the @Mail Mail Server (
http://www.atmail.com) . Using the multiserver configuration which @Mail supports, you can install more than one copy of @Mail on different machines to cluster the mail server and load the webmail interface from different machines. The software uses MySQL to store all the userdata and can be configured to use a central point for mail storage , it can support a multiserver configuration without any issues.
We won't be going into much details on how exactly @Mail was installed as their own website provides very clear instructions about the installation in multiserver mode. You should make sure the NFS mount and all the required services For more details on these you can visit
this knowlegde base article from the @Mail site itself. We will be looking into the Round Robin DNS setup which would need to be done for this setup.
You can run Pop3/IMAP , SMTP and Webmail services from different servers when you run @Mail in multiserver mode.You would need edit the DNS records for your domain to be able to utilize the cluster setup on your domain. We normally use ISC Bind as the nameserver on our setups and we used the same for this setup. We will consider the hypothetical domain used for the setup as yourdomain.com throughout this article.
Our cluster had three nodes namely: node1.yourdomain.com (123.123.123.126), node2.yourdomain.com (123.123.123.127) and node3.yourdomain.com (123.123.123.128) . We installed @Mail on all of them as per the official multiserver installation instuctions and it shared the same MySQL db and used the central NFS storage area as well. The setup requires the MX records for the domain to be pointed to all the 3 nodes. The MX priority for each of these mail servers should be the same so that the mails are distributed properly to these nodes.
The DNS entries for the nodes would be as below in the zone file:
node1 IN A 123.123.123.126
node2 IN A 123.123.123.127
node3 IN A 123.123.123.128
The MX record for the domain needs to point to each of the nodes as below. The priority would remain the same. It is set to 0 in this case.
yourdomain.com. IN MX 0 node1
yourdomain.com. IN MX 0 node2
yourdomain.com. IN MX 0 node3
The above setup will set the incoming mails to be handled by any of the 3 nodes.
The remaining services would need to be load balanced to the different nodes in the same manner. This includes the Webmail and POP3/IMAP services. The setup in the DNS zone file would be as below. Using the round robin setup, if a node goes down in the cluster the request is automatically forwarded to the next node.
mail IN A 123.123.123.126
mail IN A 123.123.123.127
mail IN A 123.123.123.128
You would need the reload the DNS zone after making these changes or restart the service. You would need to verify the changes you made as below:
# dig yourdomain.com mx
;; QUESTION SECTION:
;yourdomain.com. IN MX
;; ANSWER SECTION:
yourdomain.com. 86400 IN MX 0 node3.yourdomain.com.
yourdomain.com. 86400 IN MX 0 node1.yourdomain.com.
yourdomain.com. 86400 IN MX 0 node2.yourdomain.com.
You can find below that mail.yourdomain.com resolves to 3 Ips as below.
# nslookup mail.yourdomain.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: mail.yourdomain.com
Address: 123.123.123.126
Name: mail.yourdomain.com
Address: 123.123.123.127
Name: mail.yourdomain.com
Address: 123.123.123.128
Using this method you can setup a load balanced mail cluster using @Mail. If you have additions to make, they are always welcome :)
Tags: @mail, atmail, webmail cluster
Posted in How To's | No Comments »