From bf966e8c5d3dc948df49babd2e25e2530bcf3c46 Mon Sep 17 00:00:00 2001 From: AnshumanSaini <90978443+AnshumanSaini@users.noreply.github.com> Date: Mon, 2 Jun 2025 02:39:16 +0530 Subject: [PATCH] fixes #19634 --- api/libs/smtp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/libs/smtp.py b/api/libs/smtp.py index 2325d69a41..35561f071c 100644 --- a/api/libs/smtp.py +++ b/api/libs/smtp.py @@ -28,7 +28,8 @@ class SMTPClient: else: smtp = smtplib.SMTP(self.server, self.port, timeout=10) - if self.username and self.password: + # Only authenticate if both username and password are non-empty + if self.username and self.password and self.username.strip() and self.password.strip(): smtp.login(self.username, self.password) msg = MIMEMultipart()