aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--climl/imap.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/climl/imap.py b/climl/imap.py
index 0de15d8..5bd2834 100644
--- a/climl/imap.py
+++ b/climl/imap.py
@@ -51,18 +51,10 @@ def connect_to_imap(conf, password):
connection.login(username=conf.get('imap.username'), password=password)
print('successfuly logged')
- # TODO: replace shutdown by logouts when it will not timeout through ssl
- try:
- yield connection
- #connection.logout()
- except (connection.AbortError, socket.error, socket.timeout,
- backports.ssl.SSLError, backports.ssl.CertificateError):
- raise
- else:
- pass
- #connection.logout()
- finally:
- connection.shutdown()
+ # never try to shutdown socket or send a logout since the goal of climl is
+ # to stay connected, if this fails it is an error and thus no need to try
+ # to be nice with a logout to a dead connection.
+ yield connection
def imap_waiter(connection):