Commit dc6b231b authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Check if on shinypro to send mail

parent e9e23877
pip3 install bioblend python-daemon
This diff is collapsed.
......@@ -35,6 +35,7 @@ import tarfile
import zipfile
import lockfile
import datetime
import socket
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
......@@ -418,11 +419,12 @@ class galaxy(Thread):
"attachment; filename= {0}"
.format(os.path.basename(result_file)))
msg.attach(part)
server = smtplib.SMTP('smtp.pasteur.fr', 587)
server.starttls()
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()
if socket.gethostname() == "ShinyPro":
server = smtplib.SMTP('smtp.pasteur.fr', 587)
server.starttls()
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()
#smtplib.SMTPSenderRefused:
#except IOError:
# self.logger.error("Error cannot open {0}".format(result_file))
......
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