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): ...@@ -639,8 +639,21 @@ class Workflow(threading.Thread):
# envelope header. # envelope header.
s = smtplib.SMTP(smtps, smtpp) s = smtplib.SMTP(smtps, smtpp)
s.ehlo() s.ehlo()
# if the SMTP server does not provides TLS or identification
s.starttls() s.starttls()
s.login(me, fromp) 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()) s.sendmail(me, [you], msg.as_string())
s.close() s.close()
except: except:
Supports Markdown
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