diff --git a/Changelog.rst b/Changelog.rst index 2564ae5..7acccd3 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -12,6 +12,7 @@ WIP (add new stuff for the next release) * Actually perform the SSL fingerprint check (reported by J. Cook) * Curses UI, don't use colors after we shut down curses already (C.Höger) * Document that '%' needs encoding as '%%' in *.conf +* Fix crash when IMAP.quickchanged() led to an Error (reported by sharat87) OfflineIMAP v6.5.3.1 (2012-04-03) ================================= diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 6bdcc71..bb1b51f 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -93,14 +93,17 @@ class IMAPFolder(BaseFolder): # Select folder and get number of messages restype, imapdata = imapobj.select(self.getfullname(), True, True) + self.imapserver.releaseconnection(imapobj) except OfflineImapError as e: # retry on dropped connections, raise otherwise self.imapserver.releaseconnection(imapobj, True) if e.severity == OfflineImapError.ERROR.FOLDER_RETRY: retry = True else: raise - finally: - self.imapserver.releaseconnection(imapobj) + except: + # cleanup and raise on all other errors + self.imapserver.releaseconnection(imapobj, True) + raise # 1. Some mail servers do not return an EXISTS response # if the folder is empty. 2. ZIMBRA servers can return # multiple EXISTS replies in the form 500, 1000, 1500,