From a098825fcc49e5fcff628d296ca922138ec197d5 Mon Sep 17 00:00:00 2001 From: AuditAIH <145266260+AuditAIH@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:50:35 +0800 Subject: [PATCH] Update smtp.py (#21335) --- api/libs/smtp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/libs/smtp.py b/api/libs/smtp.py index 35561f071..b94386660 100644 --- a/api/libs/smtp.py +++ b/api/libs/smtp.py @@ -22,7 +22,11 @@ class SMTPClient: if self.use_tls: if self.opportunistic_tls: smtp = smtplib.SMTP(self.server, self.port, timeout=10) + # Send EHLO command with the HELO domain name as the server address + smtp.ehlo(self.server) smtp.starttls() + # Resend EHLO command to identify the TLS session + smtp.ehlo(self.server) else: smtp = smtplib.SMTP_SSL(self.server, self.port, timeout=10) else: