KeyError during IMAP to IMAP sync of deleted msgs

Dan Christensen jdc at
Tue Dec 8 16:52:50 GMT 2009

Dan Christensen <jdc at> writes:

> I saved a copy of dovecot's maildir at the local end from before and
> after, and noticed that *all* the filenames changed.  Is this normal?

I see that offlineimap adds a header to all messages stored in a local
IMAP server.  Is this necessary?  The FAQ says:

  Why are your Maildir message filenames so long?

  OfflineIMAP has two relevant principles: 1) never modifying your
  messages in any way

I realize that this is discussing the maildir support, but it seems like
a good principle in general to not modify the messages.  1) It is risky:
a bug or a crash might corrupt/lose a message.  2) It means that clients
need to redownload the message.  3) Clients think there is new mail when
there isn't (because the UID sequence numbers go by two instead of one)
or get confused about how many new messages there are.  4) If I am
viewing a message while offlineimap runs in the background, the message
may disappear and any flags I set on it may be lost.  5) It causes extra
disk writes (very noticeable during a large upstream sync.)

I'm just curious why this header is needed, and whether it is worth the
potential problems.  Couldn't offlineimap use a hash of each message to
identify messages?  (Identical messages would get the same hash, but I
suspect this would be a plus not a minus.  E.g. if same message appears
in two folders, only one copy would need to be transferred.)

Also, does offlineimap change the local maildir filenames when syncing
IMAP -> maildir instead of IMAP -> IMAP?  If so, points 2), 3) and 4)
above may apply to that situation too.

[I think all of the above is only really important for new local
messages.  But since messages I send are often copied to a local Sent
folder, it is relevant.]


More information about the OfflineIMAP-project mailing list