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

No commit message

No commit message
parent 5eb31c76
......@@ -639,8 +639,21 @@ class Workflow(threading.Thread):
# envelope header.
s = smtplib.SMTP(smtps, smtpp)
s.ehlo()
# if the SMTP server does not provides TLS or identification
try:
s.starttls()
s.login(me, fromp)
except smtplib.SMTPHeloError:
logging.getLogger("wf." + str(self.id)).debug("The server didn't reply properly to the HELO greeting.")
except smtplib.SMTPAuthenticationError:
logging.getLogger("wf." + str(self.id)).debug("The server didn't accept the username/password combination.")
except smtplib.SMTPException:
logging.getLogger("wf." + str(self.id)).debug("No suitable authentication method was found, or the server does not support the STARTTLS extension.")
except RuntimeError:
logging.getLogger("wf." + str(self.id)).debug("SSL/TLS support is not available to your Python interpreter.")
except:
logging.getLogger("wf." + str(self.id)).debug("Unhandled error when sending mail.")
finally:
s.sendmail(me, [you], msg.as_string())
s.close()
except:
......
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