docker-offlineimap/offlineimap
Sebastian Spaeth 8fc7227189 SEVERE: Fix getting wrong UID back on IMAP upload
This change looks harmless, but it fixes a severe bugfix, potentially
leading to data loss! It fixes the "on n new uploads, it will redownload
n-1, n-2, n-3,... messages during the next syncs" condition, and this is
what happens:

If there are more than one Mails to upload to a server, we do that by
repeatedly invoking folder.IMAP.savemessage(). If the server supports
the UIDPLUS extension we query the resulting UID by doing a:

imapobj._get_untagged_response('APPENDUID', True)

and that is exactly the problem. The "True" part causes the reply to
remain in the "response stack" of the imaplib2 library. When we do
the same call on a subsequent message and the connection is still on the
same folder, we will get the same UID response back (imaplib2 only looks
for the first matching response and returns that). The only time we
clear the response stack, is when the IMAP connection SELECTS a
different folder.

This means that when we upload 10 messages, the IMAP server gives us
always the same UID (that of the first one) back. And trying to write
out 10 different messages with the same UID will confuse OfflineIMAP.

This is the reason why we saw the ongoing UPLOADING/DOWNLOADING behavior
that people reported. And this is the reason why we saw the
inconsistency in the UID mapping in the IMAP<->IMAP case.

I urge everyone to upgrade ASAP. Sorry for that, I don't know why the
problem only became prevalent in the recent few releases as this code
has been there for quite a while.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-06 21:57:48 +01:00
..
folder SEVERE: Fix getting wrong UID back on IMAP upload 2012-01-06 21:57:48 +01:00
repository WIP, revamp how we treat top-level dirs 2012-01-06 19:08:48 +01:00
ui Remove unneeded import in MachineUI 2012-01-06 14:06:03 +01:00
__init__.py Release 6.4.4 2012-01-06 13:22:34 +01:00
accounts.py Do not create folders on readonly repositories 2012-01-05 14:05:51 +01:00
CustomConfig.py Remove deprecated calls to apply() 2011-09-27 13:00:12 +02:00
error.py Introduce new error level FOLDER_RETRY 2011-09-06 19:00:21 +02:00
imaplib2.py Bump bundled imaplib2 to 2.29 2011-11-02 10:55:42 +01:00
imaplibutil.py Fix mbox.select(foldername) readonly parameter comparison 2011-11-02 08:57:01 +01:00
imapserver.py Remove unused imapserver getdelim() 2011-12-01 10:12:54 +01:00
imaputil.py Do not fail calling dequote() with empty string 2011-09-26 15:16:59 +02:00
init.py Implement clean CTRL-C termination 2012-01-04 19:31:27 +01:00
localeval.py Update FSF address 2006-08-12 05:15:55 +01:00
mbnames.py explicitly define symbols to import instead of 'import *' 2011-05-09 22:43:03 +02:00
syncmaster.py Exit "infinite" monitorloop when SyncRunner thread exits 2011-11-02 11:55:05 +01:00
threadutil.py Exit "infinite" monitorloop when SyncRunner thread exits 2011-11-02 11:55:05 +01:00