8fc7227189
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> |
||
---|---|---|
.. | ||
__init__.py | ||
Base.py | ||
Gmail.py | ||
IMAP.py | ||
LocalStatus.py | ||
LocalStatusSQLite.py | ||
Maildir.py | ||
UIDMaps.py |