offlineimap icon indicating copy to clipboard operation
offlineimap copied to clipboard

Synch misbehavior resuming an interrupted expunge

Open DavideRossi opened this issue 3 years ago • 2 comments

General informations

  • system/distribution (with version): Linux Mint 20.1
  • offlineimap version (offlineimap -V): offlineimap v7.2.3, imaplib2 v2.57 (system), Python v2.7.18, OpenSSL 1.1.1f 31 Mar 2020
  • Python version: Python v2.7.18
  • server name or domain: outlook.office365.com
  • CLI options:

Configuration file offlineimaprc

[Account Work]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ...

[Repository Remote]
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
type = IMAP
remotehost = outlook.office365.com
remoteuser = ...
ssl = yes

I have a large mailbox folder (89k entries) with lots of duplicate messages (courtesy of thunderbird fighting with MS IMAP server). I'm using offlineimap to create a local maildir clone of the remote folder in which I run a dedup script. After the dedup removal I re-run offlineimap to sync the remote folder, which results in a huge expunge command that should remove all the duplicated messages from the remote as well. All of the times the server fails to delete all the messages (I guess because of the large number of messages to process) and offlineimap fails with a abort: command: EXPUNGE => connection terminated error. The problem is that when I run offlineimap again, it starts downloading from the remote all the duplicated messages that I just removed from local. It seems like the local status is not rolled back after the expunge failure.

DavideRossi avatar May 20 '21 12:05 DavideRossi

Sorry for the late reply.

Here's a workaround:

  1. Remove locally
  2. Sync to send the deletion IMAP command on the server, offlineimap will crash
  3. delete/backup the local maildirs and offlineimap cache (metadatadir).
  4. wait for the server to finish the removals (no idea how many times this will require).
  5. Sync again, from a new fresh setup.

nicolas33 avatar Aug 05 '21 17:08 nicolas33

Due to the end of python2, we won't try to fix this issue. I'll apply MR, if any.

nicolas33 avatar Aug 05 '21 17:08 nicolas33