initial SMTP connection now timeouts after 5 seconds, closes #70

pull/72/head
Martin Zimmermann 10 years ago
parent 154d591ae9
commit 9a735e8eac

@ -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();

Loading…
Cancel
Save