imapsync two way synchronization of deletes and explunges
Synopsis:
I am using imapsync to synchronize two Courier IMAP servers for the
purpose of having a local repository of all mail for my users. My
problem is that deletes do not synchronize between the system.
Details:
mail.example.com is a courier server running out on the Internet
somewhere. It is running Courier-IMAP, and I don't have shell access
to it.
mail2.example.com is a courier server running inside the office. I am
root.
I have approximately 60 users. All of the users use Outlook. Despite
my threatening nuclear holocaust if they continue to do so, they will
continue to do so.
imapsync is running within a script on mail2.example.com. The script
is as follows:
_________________________________________
>#cat retrieve.sh
#!/bin/bash
{ while IFS=',' read u1 p1
do
imapsync --host1 mail.example.com --user1 "$u1@example.com" --password1
"$p1" --host2 mail2.example.com --user2 "$u1@mail2.example.com"
--password2 "$p1" --delete2
find /home/vpopmail/domains/mail2.example.com/$u1/Maildir -type f -a
-name '[0-9]*' > /tmp/mail_transfer_lockfile
/usr/bin/adjust_time.pl
done } < /etc/imapsync/users
__________________________________________
Translation: read in username / password pairs from
/etc/imapsync/users and sync the accounts.
It works... mostly.
The crux of the issue is that I have (will) configure Outlook on each
system to get mail from mail2.example.com (the local server). When a
user deletes or expunges a message on mail2.example.com, it does not
replicate that delete or expunge back to mail.example.com. Hence,
deleted messages reappear magically several minutes after they are
deleted. This makes users sad (confused, terrified, unable to cope...)
One solution would be to do two syncs, i.e. mail.example.com -->
mail2.example.com, then mail2.example.com --> mail.example.com.
Unfortunately, imapsync is resource intensive, and this will increase
the delay on mail transfer from 6 minutes to 15+. Another would be a
theoretical and as yet unimplemented --delete1 option to imapsync (more
elegant, but doesn't exist).
Any other suggestions? Will post summary back to group and sacrifice a
beer to the proper authority for any assistance.
|