Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would people design a resilient mail server setup with Linux?

On an application level what the system needs to provide is both an incoming and outgoing mail service (i.e. SMTP & IMAP), along with filtering and archive storage (the archive part isn't critical yet, so we'll look at this later probably).

What is required on top of this is a resilient system, i.e. one which will handle individual server failures without interrupting service. As such I would term this a High Availability mail system. This is in contrast to a High Performance mail setup, as in our case the volume of mail being handled isn't the important factor, it's simply that it stays online.

Having not approached this problem before, the first thing I thought of was a clustered file system (gfs/gluster/etc), combined with heartbeat to failover a floating IP to another box in the case of a server failure.

Combined with postfix & dovecot does this sound feasible to people?

share|improve this question
Do you search for an open source only solution? Or are you interested in recommendation for commercial solutions as well? – Raffael Luthiger Aug 8 '10 at 13:12
up vote 2 down vote accepted

Alternatively do your clustering at the IMAP/POP level, with the likes of Cyrus IMAP. I used it's replication feature during a mail server migration and it worked perfectly. No messages were lost and which node they arrived on didn't matter.

share|improve this answer
That's a very interesting idea - I hadn't thought of IMAP replication. – Coops May 11 '10 at 10:54
Really interesting, are you using Cyrus 2.2 or 2.3 to do this? Is it ready for prime time? All I kind is stuff with warnings about it being not so. Are there any manuals for this? – Jasper Aug 8 '10 at 12:54
2.3, following what they've published. There may not be much documentation, but what's there was enough. This was on a low load mail server (about a thousand messages a day) though. – Cry Havok Aug 22 '10 at 9:10

SMTP part is quite simple i guess - both for filtering incoming traffic and providing outgoing service - they are quite stateless. so for those - usual master + hot standby setup based eg on heart-beat and 'virtual ip' assigned to active node would be just fine.

but... there is a risk of losing messages that are in transit [eg being checked by antispam or being qued up for outgoing delivery because of greylisting on the other side] when given server dies.

for imap/access to mailbox in not-so-heavily-loaded-system i would go again for master + hot-standby configuration but this time we need to add mailbox replication. depending on size - simple rsync run every 10 minutes could do the trick, but if we talk about thousands of mailboxes and thousands of messages in each - drdb-based replication would perform better.

usual word of warning: if you set up HA cluster - do check it periodically - eg every quarter or so. discovering that what you expect to be HA is not really HA when you need it is quite unpleasant feeling.

for MTA i use usually postfix, for IMAP - courier, for antispam - ESVA [ now seems to be dead but people try to revive it which got resurected ] or mailcleaner.

share|improve this answer
Thanks for the ideas, I hadn't thought of something as simple as rysncing to a standby box. – Coops May 11 '10 at 10:59
@Coops - i use it quite often, but for much smaller datasets. eg rsync firewall/reverse proxy configs from master to hot standby. – pQd May 11 '10 at 11:58

At my University, we use a combination of Cyrus IMAP and Postfix. Cyrus is replicated across 3 VM's. The HA cluster has pretty good performance and serves ~30,000 unique mailboxes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.