Offlineimap erroneously deletes 10,000 emails

Sebastian Spaeth Sebastian at
Thu May 19 16:39:03 BST 2011

On Thu, 19 May 2011 13:36:46 +0100, seanh <snhmnd at> wrote:
> Deleting 9810 messages (...) in Maildir [Archive], LocalStatus[Archive]
> where the (...) was the identifiers of 9810 messages, i.e. the entire
> contents of my Archive folder containing several years worth of archived
> personal emails. Fortunately I killed offlineimap after it had managed
> to delete only a couple of thousand emails, and before it had synced
> this change up to the IMAP server and deleted the emails from the server
> as well (which would have lost them completely).

Glad, you could prevent major damage. First of all, 6.2.0 is basically 3
years old and the maintainers of offlineimap have changed since. I
believe the first version, that we support is 6.3.2 or so.

Are you sure that the mails haven't been moved into another folder? As
that is formally a delete and add operation for offlineimap (although I
see in your later description that this is not the case).

Unfortunately, there is very little without debug logs that we can
do. IMAP servers are notoriously different in their replies and
implementations. OfflineImap would only ever delete on the local Maildir
if the server told us that mails with the mails UIDs are gone. AFAIK,
there are some versions of uw-imap that are not able to assign stable
UIDs to mails.

Are you using weird options like maxage or maxsize?

> Is this a bug in the offlineimap code? Or a bug in offlineimap's sync
> algorithm? Was there a glitch in the IMAP server that caused it to
> momentarily report the contents of the Archive folder as empty and
> trigger a catastrophic response from offlineimap? Is there a safe way to
> use offlineimap so that I can be protected from losing mail in events
> like this?

Again, all I can recommend is to update to the latest offlineimap, and
take debug logs.

It would be a pity to lose an opportunity to make offlineimap more
robust against failure.

-------------- 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