Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
0fefde87
Commit
0fefde87
authored
May 26, 2015
by
Jerome Mariette
Browse files
No commit message
No commit message
parent
5eb31c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jflow/workflow.py
View file @
0fefde87
...
...
@@ -639,10 +639,23 @@ class Workflow(threading.Thread):
# envelope header.
s
=
smtplib
.
SMTP
(
smtps
,
smtpp
)
s
.
ehlo
()
s
.
starttls
()
s
.
login
(
me
,
fromp
)
s
.
sendmail
(
me
,
[
you
],
msg
.
as_string
())
s
.
close
()
# 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
:
logging
.
getLogger
(
"wf."
+
str
(
self
.
id
)).
debug
(
"Impossible to connect to smtp server '"
+
smtps
+
"'"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment