D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] IMAP synchronisation?

 

Hi all,

I am trying to synchronise an Exchange server (with IMAP enabled) with a
Dovecot IMAP server.

I have discovered the "imapsync" tool and things seem to be OKish, but
with one potentially huge problem.  Essentially my script loops over a
list of usernames and passwords (in clear text, of course... security
isn't a dirty word, BlackAdder...) and synchronises the Exchange IMAP
and Dovecot IMAP nicely... however, although it seems to delete/expunge
the messages (ie the deleted messaged do *not* appear in the Inbox),
they seem to be retained.

For example, one user (a new user) has only 5 messages on their
Exchange account.  After IMAPSyncing, Dovecot has 5 messages.  After a
second round of IMAPSyncing, Exchange = 5, Dovecot = 10; next Exchange
= 5, Dovecot = 15... :-|

My script is invoked as:
exchange-to-dovecot.awk list-of-accounts >> logfile 2>/dev/null

list-of-accounts contains entries in this manner:
NAMEPASS: username1 password1 username2 password2

The script itself is:
#!/usr/bin/awk -f
BEGIN {
  print system("date")
  print "--------------------"
}
{
    FS=":"
}
/NAMEPASS/ {
  print $2 " " $3 " " $4 " " $5
  system("imapsync \
  --syncinternaldates \
  --host1 server1 --user1 "$2" --password1 "$3" --noauthmd5 --ssl1 \
  --host2 server2 --user2 "$4" --password2 "$5" --noauthmd5 --ssl2 \
  --delete2")
  print "--------------------"
}

Now, I am *guessing* that my problem is caused by Exchange since I have
attempted this synchronisation between 2 Dovecot servers and didn't
(seem) to get this problem.

For users with only a few emails, this would take quite a while to
cause issues, however at least one of the users (who is not yet on the
Exchange server... still pulls her emails down via POP3 onto her local
machine) has around 4GB of mail already.  Clearly if her mail gets
duplicated in this manner, my virtual server will run out of virtual
space very quickly!

Anybody got any thoughts?  (And no, getting rid of Exchange/SBS2008 is
not an option, much as I would love it to be.)

Cheers.
Grant. :)

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html