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(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: except:
logging.getLogger("wf." + str(self.id)).debug("Impossible to connect to smtp server '" + smtps + "'") logging.getLogger("wf." + str(self.id)).debug("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