offlineimap
offlineimap copied to clipboard
Synch misbehavior resuming an interrupted expunge
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.
Sorry for the late reply.
Here's a workaround:
- Remove locally
- Sync to send the deletion IMAP command on the server, offlineimap will crash
- delete/backup the local maildirs and offlineimap cache (metadatadir).
- wait for the server to finish the removals (no idea how many times this will require).
- Sync again, from a new fresh setup.
Due to the end of python2, we won't try to fix this issue. I'll apply MR, if any.