initial SMTP connection now timeouts after 5 seconds, closes #70
This commit is contained in:
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…
Reference in New Issue
Block a user