diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-08 20:09:53 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-08 20:09:53 +0530 |
commit | 91993686028df1df3af6aea2c28ced81b242943e (patch) | |
tree | 866052d46421c8582d1d68ac4b2ebb0e095fbad8 | |
parent | 37076cab79175c0797ce781bb1cc4cd8e60187ce (diff) |
added email configuration to config.ini
-rw-r--r-- | app/dock-single.py | 6 | ||||
-rw-r--r-- | app/dock_docker.py | 6 | ||||
-rw-r--r-- | config.ini | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/app/dock-single.py b/app/dock-single.py index b5d9351..daf920c 100644 --- a/app/dock-single.py +++ b/app/dock-single.py @@ -183,7 +183,7 @@ def email(zipArchive): from email.mime.base import MIMEBase from email import encoders - fromaddr = "navanchauhan@gmail.com" + fromaddr = config['SMTP']['EMAIL'] msg = MIMEMultipart() msg['From'] = fromaddr @@ -200,9 +200,9 @@ def email(zipArchive): p.add_header('Content-Disposition', "attachment; filename= %s" % filename) msg.attach(p) - s = smtplib.SMTP('smtp.gmail.com', 587) + s = smtplib.SMTP(config['SMTP']['SERVER'], config['SMTP']['PORT']) s.starttls() - s.login(fromaddr, 'okrs shoc ahtk idui') + s.login(fromaddr, config['SMTP']['PASSWORD']) text = msg.as_string() s.sendmail(fromaddr, toaddr, text) diff --git a/app/dock_docker.py b/app/dock_docker.py index 5869c21..bd6f053 100644 --- a/app/dock_docker.py +++ b/app/dock_docker.py @@ -28,7 +28,7 @@ def email(zipArchive): from email.mime.base import MIMEBase from email import encoders - fromaddr = "navanchauhan@gmail.com" + fromaddr = config['SMTP']['EMAIL'] toaddr = toEmail msg = MIMEMultipart() @@ -46,9 +46,9 @@ def email(zipArchive): p.add_header('Content-Disposition', "attachment; filename= %s" % filename) msg.attach(p) - s = smtplib.SMTP('smtp.gmail.com', 587) + s = smtplib.SMTP(config['SMTP']['SERVER'], config['SMTP']['PORT']) s.starttls() - s.login(fromaddr, 'okrs shoc ahtk idui') + s.login(fromaddr, config['SMTP']['PASSWORD']) text = msg.as_string() s.sendmail(fromaddr, toaddr, text) @@ -5,6 +5,12 @@ USER = curieweb PASSWORD = curie-web-russian-54 NAME = curie +[SMTP] +SERVER = smtp.gmail.com +PORT = 587 +EMAIL = navanchauhan@gmail.com +PASSWORD = okrs shoc ahtk idui + [LOGS] ERRORS = logs/errors.log INFO = data/info.log |