From 04501fdda362a71a7ba7c8abc1ee07d360b320ee Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 8 Aug 2024 17:20:24 +0000 Subject: Fix bug with sending e-mails We changed the from address from genenetwork.org to uthsc.edu, which seems to have fixed the issue with e-mails not being properly sent. We also stopped activating tls --- gn_auth/smtp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gn_auth/smtp.py b/gn_auth/smtp.py index 0c9f878..a2d86b0 100644 --- a/gn_auth/smtp.py +++ b/gn_auth/smtp.py @@ -23,7 +23,7 @@ def build_email_message(# pylint: disable=[too-many-arguments] htmlmessage: str = "", attachments: tuple[str, ...] = tuple(), from_address: Address = Address( - "GeneNetwork Automated Emails", "no-reply", "genenetwork.org") + "GeneNetwork Automated Emails", "no-reply", "uthsc.edu") ) -> EmailMessage: """Build an email message.""" msg = EmailMessage() @@ -53,6 +53,5 @@ def send_message(# pylint: disable=[too-many-arguments] """Set up a connection to a SMTP server and send a message.""" logging.debug("Email to send:\n******\n%s\n******\n", message.as_string()) with smtplib.SMTP(host, port, local_hostname, timeout, source_address) as conn: - conn.starttls() - conn.login(smtp_user, smtp_passwd) + conn.ehlo() conn.send_message(message) -- cgit v1.2.3