Commit 0fefde87 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 5eb31c76
...@@ -639,10 +639,23 @@ class Workflow(threading.Thread): ...@@ -639,10 +639,23 @@ class Workflow(threading.Thread):
# envelope header. # envelope header.
s = smtplib.SMTP(smtps, smtpp) s = smtplib.SMTP(smtps, smtpp)
s.ehlo() s.ehlo()
s.starttls() # if the SMTP server does not provides TLS or identification
s.login(me, fromp) try:
s.sendmail(me, [you], msg.as_string()) s.starttls()
s.close() s.login(me, fromp)
except smtplib.SMTPHeloError:
logging.getLogger("wf." + str("The server didn't reply properly to the HELO greeting.")
except smtplib.SMTPAuthenticationError:
logging.getLogger("wf." + str("The server didn't accept the username/password combination.")
except smtplib.SMTPException:
logging.getLogger("wf." + str("No suitable authentication method was found, or the server does not support the STARTTLS extension.")
except RuntimeError:
logging.getLogger("wf." + str("SSL/TLS support is not available to your Python interpreter.")
logging.getLogger("wf." + str("Unhandled error when sending mail.")
s.sendmail(me, [you], msg.as_string())
except: except:
logging.getLogger("wf." + str("Impossible to connect to smtp server '" + smtps + "'") logging.getLogger("wf." + str("Impossible to connect to smtp server '" + smtps + "'")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment