Increase compatability with Gmail
When uploading a new message to Gmail we need to find out the UID it assigned it, but Gmail does not advertize the UIDPLUS extension (in all cases) and it fails to find the email that we just uploaded when searching for it. This prevented us effectively from uploading to gmail. See analysis in http://lists.alioth.debian.org/pipermail/offlineimap-project/2011-March/001449.html for details on what is going wrong. This patch increases compatability with Gmail by checking for APPENDUID responses to an APPEND action even if the server did not claim to support it. This restores the capability to upload messages to the *broken* Gmail IMAP implementation. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
105da1b0c3
commit
09515f8f90
@ -439,8 +439,9 @@ class IMAPFolder(BaseFolder):
|
||||
(typ,dat) = imapobj.check()
|
||||
assert(typ == 'OK')
|
||||
|
||||
# get the UID.
|
||||
if use_uidplus:
|
||||
# get the new UID. Test for APPENDUID response even if the
|
||||
# server claims to not support it, as e.g. Gmail does :-(
|
||||
if use_uidplus or imapobj._get_untagged_response('APPENDUID', True):
|
||||
# get the new UID from the APPENDUID response, it could look like
|
||||
# OK [APPENDUID 38505 3955] APPEND completed
|
||||
# with 38505 bein folder UIDvalidity and 3955 the new UID
|
||||
|
Reference in New Issue
Block a user