diff --git a/Changelog.draft.rst b/Changelog.draft.rst index 76a0ea3..9bae1d8 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -16,5 +16,9 @@ New Features Changes ------- +* Refresh server capabilities after login, so we know that Gmail + supports UIDPLUS (it only announces that after login, not + before). This prevents us from adding custom headers to Gmail uploads. + Bug Fixes --------- diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index dc0bc50..ead3280 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -1,6 +1,5 @@ # IMAP server support -# Copyright (C) 2002 - 2007 John Goerzen -# +# Copyright (C) 2002 - 2011 John Goerzen & contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -276,6 +275,11 @@ class IMAPServer: self.passworderror = str(val) raise + # update capabilities after login, e.g. gmail serves different ones + typ, dat = imapobj.capability() + if dat != [None]: + imapobj.capabilities = tuple(dat[-1].upper().split()) + if self.delim == None: listres = imapobj.list(self.reference, '""')[1] if listres == [None] or listres == None: