From 121b5cdf32c71ba13653de9c170cb036521f189e Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Tue, 10 Jan 2023 21:12:37 +1100 Subject: [PATCH] SMTP_SKIP_TLS fix --- back/pialert.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index 8653638f..5c9de76b 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -2394,24 +2394,18 @@ def send_email (pText, pHTML): smtp_connection.ehlo() try: - if not SafeParseGlobalBool("SMTP_SKIP_TLS"): + if not SMTP_SKIP_TLS: smtp_connection.starttls() smtp_connection.ehlo() - if not SafeParseGlobalBool("SMTP_SKIP_LOGIN"): + if not SMTP_SKIP_LOGIN: smtp_connection.login (SMTP_USER, SMTP_PASS) smtp_connection.sendmail (REPORT_FROM, REPORT_TO, msg.as_string()) smtp_connection.quit() except smtplib.SMTPAuthenticationError as e: - file_print(' ERROR: Couldn\'t connect to the SMTP, skipping Email') + file_print(' ERROR: Couldn\'t connect to the SMTP server, skipping Email') -#------------------------------------------------------------------------------- -def SafeParseGlobalBool(boolVariable): - if boolVariable in globals(): - return eval(boolVariable) - return False - #------------------------------------------------------------------------------- def send_webhook (_json, _html):