Jun 282011

After I wrote about Maildir replication, using ChironFS and DRBD, this time I will write how to make maildir replication, using a very well known program utility called rsync. basically, rsync itself, does not do realtime replication process. rsync only perform the synchronization/copy process when needed or scheduled by using the crontab. like cp, rsync is used to copy files from one directory to another directory in one system, or to a directory on another system. and vice versa.

How do we make the process of replication/copy that is almost realtime by using rsync?

we will use the inotify-tools (inotifywait) to monitor changes to system files or directories, in this case is the postfix maildir. Inotify has been included in the mainline Linux kernel from release 2.6.13 (June 18, 2005), and could be compiled into 2.6.12 and possibly earlier releases by use of a patch.

What is inotify?

Inotify is a Linux kernel subsystem that acts to extend filesystems to notice changes to the filesystem, and report those changes to applications. It replaces an earlier facility, dnotify, which had similar goals.

OK, without further ado, let’s continue with the first step, install inotify-tools. on my centos machine, it can be done in the following way.

$ sudo yum -y install inotify-tools

Assume that we have two servers, first server contains a postfix + maildir. second servers is used to backup maildir from the first server. using inotifywait, any changes in the maildir on first server will trigger rsync to update the maildir on the backup server. However, first we will make rsync can do the login automatically to the backup server via ssh using Public Key Based Authentication.

On First server

[first_server] $ ssh-keygen -t dsa -f ~/.ssh/identity && cat ~/.ssh/identity.pub | ssh -l postfix second_server -p 12345 'sh -c "cat - >>~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"'

Continue reading »

Jun 212011




  • 20110420

Performance: a high load of DSN success notification requests could slow down the queue manager. Solution: make the trace client asynchronous, just like the bounce and defer clients. Problem reported by Eduardo M. Stelmaszczyk of terra.com.br. Files: global/abounce.[hc], *qmgr/qmgr_active.c (the qmgr_active.c files are identical).

  • 20110418

Bugfix (introduced Postfix 2.3 and Postfix 2.7): the Milter client reported some “file too large” errors as temporary errors. Problem reported by Michael Tokarev. Files: milter/milter8.c, cleanup/cleanup_milter.c.

  • 20110426

Bugfix (introduced in Postfix 1.1, duplicated in Postfix 2.3, unrelated mistake in Postfix 2.7): the local(8) delivery agent ignored table lookup errors in mailbox_command_maps, mailbox_transport_maps, fallback_transport_maps and (while bouncing mail to alias) alias owner lookup. Problem reported by William Ono. Files: local/command.c, local/mailbox.c, local/unknown.c, local/bounce_workaround.c.

  • 20110601

Bugfix (introduced Postfix 2.6 with master_service_disable) loop control error when parsing a malformed master.cf file. Found by Coverity. File: master/master_ent.c.

  • 20110602

Bugfix (introduced: Postfix 2.7): “sendmail -t” reported “protocol error” after queue file write error. File: postdrop/postdrop.c.

  • 20110614

Linux kernel version 3 support. Linus Torvalds has reset the counters for reasons not related to changes in code. Files: makedefs, util/sys_defs.h.

  • 20110615

Workaround: some Spamhaus RHSBL rejects lookups with “No IP queries” even if the name has an alphanumerical prefix. We play safe, and skip both RHSBL and RHSWL queries for names ending in a numerical suffix. File: smtpd/smtpd_check.c.