Have you checked out DRBD (http://www.drbd.org/)?

I'm running a fully redundant qmail-ldap installation with two incoming MX
servers and two outbound SMTP servers (load balanced).  Storage server with
DRBD in the works to provide active/passive storage server failover.

-Frank

-----Original Message-----
From: Lazy [mailto:lazy...@gmail.com] 
Sent: Friday, April 17, 2009 5:52 AM
To: qmail-ldap@qmail-ldap.org
Subject: failover with qmail-ldap

Hi all
I'm trying to build a redundant mail system using qmail-ldap.
The idea is to have 1 primary server and a secondary one which could
take over in seconds or even work as a secondary MX.

Primary server will be handling pop3 and imap.

Servers would be using same ldap directory.

When a primary server gets an email it delivers it locally and sends a
copy to the secondary server using qmpc and maybe some hack in
qmail-queue or qmail-local. Secondary server keeps
 these messages in some kind of log of incoming messages, so they can
by later reinserted to the queue by some script and qmpc. When
secondary server receives an email, it adds it to the log of incoming
messages and delivers it to primary server using similarly patched
qmpc, or queue.

So we get a file or files with all the incoming messages on secondary
and real delivery done only on primary server.

When primary server dies all we need to do is reconfigure secondary to
deliver incoming messages locally, not forward it to now defunct
primary server, run a script to inject all the messages from the
incoming messages log on secondary server that now is becoming primary
and change ip for pop3 imap traffic.
Of course clients will see all todays email delivered again (pop3
clients) or marked again as new and undeleted (for imap clients).

Daily there would be a rsync of mail storage from primary to
secondary, and cleaning incoming messages log on secondary.
on primary:
1. Stop qmail-local
2. wait for local deliveries to complete
3. make a snapshot of mail storage volume
4. signal secondary to clean/rotate incoming messages log
5. start qmail-local
6. rsync primary mail storage snapshot to secondary


What do You think of that ? Could anyone give me any pointers on how
and where patch qmail-queue or qmail-local, or how to make sure steps
1 - 6 get a consistent backup of incomming messages log and mail
storage snapshot. Mayby it's posiible to do it in some other simpler
way ?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to