From cc754122fc11ff1ed4ce4d28b543f99f2a8a29ce Mon Sep 17 00:00:00 2001 From: Leo Q Date: Fri, 22 Mar 2024 17:58:21 +0800 Subject: [PATCH] Authentication is only applied when both the username and password have values. (#2937) --- api/libs/smtp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/libs/smtp.py b/api/libs/smtp.py index 6c8e0c2777..30a795bd70 100644 --- a/api/libs/smtp.py +++ b/api/libs/smtp.py @@ -16,7 +16,7 @@ class SMTPClient: smtp = smtplib.SMTP(self.server, self.port) if self._use_tls: smtp.starttls() - if (self.username): + if self.username and self.password: smtp.login(self.username, self.password) msg = MIMEMultipart() msg['Subject'] = mail['subject']