At the moment i do a simple Mail-Backup: On the server there is a Maildir, and i use rsync to sync the Maildir from server to backup.
So i delete on the Server every file which is older than i.e. one month. So i have only the latest mails on the server and the rest in the Backup only. So i do not use much space on the server, and if somebody hacks me, he will get only a month of mails instead of the whole archive.
the commands i use are:
rsync -avz Maildir/ backupserver:backup/Mails/ cd Maildir touch -d 2011-07-30 dummy find -type f \! -newer dummy -delete
That is working pretty good, but when i move a mail, which is already in the backup, i will have two copies of the mail in the backup. One copy from the old backup job, one from the new one. Or i may even decide to delete the mail and it will not be deleted in the backup.
I could use rsync with --delete, but then i need to have the full archive on the server, because otherwise it will delete the old mails in the backup, too.
So now my question is: How can i sync the Mails in a way, that preserves moves and deletions?