[SWLUG] rsync & Maildir
Foeh Mannay
swlug at wormtail.co.uk
Fri Aug 11 21:29:51 UTC 2006
Hi,
The setup I am playing with at the moment is a pair of mail servers
colocated (arf) at two different houses and riding on 2 different ADSL
connections. The problem is that the one at my house is still being fairly
regularly messed with and broken, while the reliable one at the remote
location is riding on a rather bad ADSL connection.
While I know the proper answer would be to stop breaking the local server,
I've been experimenting with a solution that will mean I can always
collect my mail via squirrelmail or IMAP and I won't lose any. What I have
tried is running an hourly cron job on both machines to contact its
partner which uses rsync to copy over the contents of my ~/Maildir
directory.
Spot the deliberate mistake... whenever I delete or move a mail, within an
hour it's back again :o\
Short of deleting it from both machines via squirrelmail / IMAP, can
anyone think of an automated solution which takes into account the way in
which Maildir works? i.e. if a new file arrives on one, copy it to the
other, if an existing file is removed from one, remove it from the other.
It all sounds a bit transactional to be done by a shell script if you ask
me. Does anyone know better? Perhaps I could do something with ls, diff
and sed as a cron job to spot any deleted files, then execute a remote
delete using ssh. If someone has done this before or there's an
out-of-the-box solution, obviously that would be preferable to crufting
something together myself that could break my mailbox :o)
Thanks,
Foeh
More information about the Swlug
mailing list