From 9a735e8eac7837fb92d91c79e316ca01a4c1bd66 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Mon, 3 Mar 2014 23:42:35 +0100 Subject: [PATCH] initial SMTP connection now timeouts after 5 seconds, closes #70 --- isso/ext/notifications.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index 3283bd6..ef9459a 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -58,7 +58,9 @@ class SMTP(object): def __enter__(self): klass = (smtplib.SMTP_SSL if self.conf.get('security') == 'ssl' else smtplib.SMTP) - self.client = klass(host=self.conf.get('host'), port=self.conf.getint('port')) + self.client = klass(host=self.conf.get('host'), + port=self.conf.getint('port'), + timeout=5) if self.conf.get('security') == 'starttls': self.client.starttls();