Offlineimap duplicating email redux

Sebastian Spaeth Sebastian at
Thu Jan 20 14:32:02 GMT 2011

On Wed, 19 Jan 2011 23:02:13 -0500, "Edward Z. Yang" <ezyang at MIT.EDU> wrote:
>         for uid in self.getmessagelist().keys():
>             if uid < 0:                 # Ignore messages that pass 1 missed.
>                 continue
>             if not uid in dest_messagelist:
>                       .....copy away....

> In particular, notice that we only test dest_messagelist (presumably
> LocalStatus) when determining whether or not to copymessageto, which
> then unconditionally resaves the message.

Just to make clear, how my sync strategy change is fixing this. 

syncmessagesto_copy() still compares against LocalStatus, and will
invoke self.copymessageto(...) if eg LocalStatus had been corrupted. But
copymessageto() has become smarter and will not copy the message if the
same UID is already present on dstfolder.

   +            if dstfolder.uidexists(uid):
   +                # dst already has a message with that UID, so only update status
   +                statusfolder.savemessage(uid, None, flags, rtime)
   +                return

It will only update the statusfolder (repairing the StatusFolder
corruption) but not upload our local message to the IMAP server (where
it would get assigned a new UID and we would redownload it, duplicating

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list