Offlineimap erroneously deletes 10,000 emails

Johannes Stezenbach js at sig21.net
Thu May 19 20:55:33 BST 2011


On Thu, May 19, 2011 at 08:09:08PM +0200, martin f krafft wrote:
> also sprach seanh <snhmnd at gmail.com> [2011.05.19.1944 +0200]:
> > Definitely not. Lavabit doesn't do that, and the emails are still now in
> > the folder on the lavabit IMAP server.
> 
> Then their UIDs changed for whatever reason. Make a backup and find
> out whether offlineimap redownloads the messages after deleting
> them.

I wouldn't do that, it can create a mess if the old and new UID ranges overlap.
It's better to move the old local mails out of the way and sync
a fresh copy from IMAP.

>From the log three mails back:

  Folder sync XXX at lavabit.com[Archive]: Syncing Archive: IMAP -> Maildir
  Folder sync XXX at lavabit.com[Archive]: Deleting 9810 messages (174718976, 
  ...
  174718974) in Maildir[Archive], LocalStatus[Archive]

which I think means they were deleted in IMAP already and are
now deleted locally due to the syncing.

Normally, if the UIDs on the server change (e.g. because the admin
has moved your mails to another server), the idea is that the
UIDVALIDITY changes, too.  Then offlineimap can detect this
condition and will abort (isuidvalidityok() returns false),
so that you have a chance to move your local mails out of the way.

If the UIDs on the server all change but UIDVALIDITY does not, then
in the best case offlineimap will delete all mails locally and
will download them again with new UID.  However, if the new and
old UID ranges overlap then the offlineimap sync process might
actually lose mails.

Thus:
1. check if the UIDs have changed on the server
2. check the UIDVALIDITY has not changed on the server
3. if both are true, complain to your server admin

http://tools.ietf.org/html/rfc3501#section-2.3.1.1


HTH
Johannes




More information about the OfflineIMAP-project mailing list