[PATCH 2/2] folder.IMAP: Make use of the new connection discarding

Sebastian Spaeth Sebastian at SSpaeth.de
Mon Sep 12 09:26:43 BST 2011

In getmessage() we were releaseing a connection when we detected a
dropped connection, but it turns out that this was not enough, we need
to explicitely discard it when we detect a dropped one. So add the
drop_conn=True parameter that was recently introduced to force the
discarding of the dead conection.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
 offlineimap/folder/IMAP.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py
index c16b4de..ace2aa0 100644
--- a/offlineimap/folder/IMAP.py
+++ b/offlineimap/folder/IMAP.py
@@ -220,7 +220,7 @@ class IMAPFolder(BaseFolder):
                     fails_left = 0
                 except imapobj.abort(), e:
                     # Release dropped connection, and get a new one
-                    self.imapserver.releaseconnection(imapobj)
+                    self.imapserver.releaseconnection(imapobj, True)
                     imapobj = self.imapserver.acquireconnection()
                     self.ui.error(e, exc_info()[2])
                     fails_left -= 1

More information about the OfflineIMAP-project mailing list