diff --git a/offlineimap/folder/Gmail.py b/offlineimap/folder/Gmail.py index bf040e9..48460d9 100644 --- a/offlineimap/folder/Gmail.py +++ b/offlineimap/folder/Gmail.py @@ -99,7 +99,14 @@ class GmailFolder(IMAPFolder): needupdate = copy(uidlist) for result in r: + if result == None: + # Compensate for servers that don't return anything from + # STORE. + continue attributehash = imaputil.flags2hash(imaputil.imapsplit(result)[1]) + if not ('UID' in attributehash and 'FLAGS' in attributehash): + # Compensate for servers that don't return a UID attribute. + continue flags = attributehash['FLAGS'] uid = long(attributehash['UID']) self.messagelist[uid]['flags'] = imaputil.flagsimap2maildir(flags)