I have a Zarafa server (with Postfix as delivery agent) that I would like to add realtime backup to. It already:
- Backs up it's database with mysqldump and all the file system using rdiff-backup every night.
- Has a fallback using DRBD (machine is a Xen virtual machine with DRBD backend). So in case primary goes down, I can bring up the virtual machine on the backup host instantly.
In case of file system/database corruption, I would like to have a realtime backup of incoming mail as to prevent loss of those messages received after the nightly backup.
Zarafa delivery works like this (excerpt from Postfix' main.cf):
mailbox_transport = zarafa: zarafa_destination_recipient_limit = 1 virtual_alias_maps = mysql:/etc/postfix/mysql-aliases.cf
The mailbox transport (as defined in master.cf) is a tool that accepts data on stdin to deliver into Zarafa's store (mysql + file based). Virtual_alias_maps is an SQL command which basically return the
firstname.lastname@example.org, but only for existing users. In other words, it retrieves the Zarafa username from the e-mail address.
One thing I can think of, is to deliver all mail to a second transport which sends it to another server. This server can be a simple courier maildir server and fetchmail can be configured to redeliver using SMTP to a server restored from backup.
But, this is not 100% elegant and I wouldn't even know how to do it...
Any better/implementation ideas...?
Edit: I now have a second mailserver configured so that it dumps all incoming mail for the relevant domain into one mailbox with
Delivered-To: headers, so I can retrieve them using fetchmail and deliver them to those addresses (fetchmail has an option for that, I've been told). Now to let Postfix on the primary deliver to two transports...