diff options
-rw-r--r-- | climl_imap_bridge.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/climl_imap_bridge.py b/climl_imap_bridge.py index be0864a..9466a96 100644 --- a/climl_imap_bridge.py +++ b/climl_imap_bridge.py @@ -52,8 +52,9 @@ def connect_to_imap(conf, password): try: yield connection - except IMAPClient.AbortError, socket.error, socket.timeout, \ - backports.ssl.SSLError, backports.ssl.CertificateError: + connection.logout() + except (imapclient.AbortError, socket.error, socket.timeout, + backports.ssl.SSLError, backports.ssl.CertificateError): raise else: connection.logout() |