From cb7e02c645bcbe2b20b08f7a456dfce813b4ccfa Mon Sep 17 00:00:00 2001 From: Patrick Ulbrich Date: Fri, 15 Jan 2021 20:09:36 +0100 Subject: [PATCH] dispose current connection on any error (related to #186) --- Mailnag/backends/imap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mailnag/backends/imap.py b/Mailnag/backends/imap.py index 91bddca..08e971e 100644 --- a/Mailnag/backends/imap.py +++ b/Mailnag/backends/imap.py @@ -175,7 +175,8 @@ class IMAPMailboxBackend(MailboxBackend): # idle callback (runs on a further thread) def _idle_callback(args): # check if the connection has been reset by provider - if (args[2] != None) and (args[2][0] is self._conn.abort): + aborted = args[2] # (typ, val) + if aborted is not None: # conn has already been closed, don't try to close it again # self._conn.close() # (calls idle_callback)