From 8cdfef4bcefdb7ef5007129542bf62579ea3f1fc Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 21:20:14 +0100 Subject: [PATCH 1/2] Update eMail.py Using only SMTP via SSL can lead to errors depending on the configuration of the mail server As there is no switch in the config file (which is good so) the approach is to use SSL first and, if this fails, switch to non-SSL connection. Due to the importance of this plugin the pull request is affecting the master-branch. --- plugins/eMail/eMail.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index 9c75fea..1919787 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -103,7 +103,10 @@ def run(typ,freq,data): # # connect to SMTP-Server # - server = smtplib.SMTP_SSL(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) + try: + server = smtplib.SMTP_SSL(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) + except: + server = smtplib.SMTP(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) # debug-level to shell (0=no debug|1) server.set_debuglevel(0) From 20e9f567a06f29a2752f7a305e3a18358c383115 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 21:22:22 +0100 Subject: [PATCH 2/2] Update eMail.py Fixing if-condition for TLS --- plugins/eMail/eMail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index 1919787..cd697b9 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -111,7 +111,7 @@ def run(typ,freq,data): server.set_debuglevel(0) # if tls is enabled, starttls - if globalVars.config.get("eMail", "tls"): + if globalVars.config.getboolean("eMail", "tls"): server.starttls() # if user is given, login