From e40e9db39ab2a004cbde97004f619573b19be91b Mon Sep 17 00:00:00 2001 From: Anshuman Saini <90978443+AnshumanSaini@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:08:48 +0530 Subject: [PATCH] fixes #19634 (#20545) --- 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()