Skip to content

Commit 26e14a2

Browse files
committed
More fixes
1 parent 7b6ec86 commit 26e14a2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

email/1.3.0/src/app.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,18 @@ def send_email_smtp(self, smtp_host, recipient, subject, body, smtp_port, attach
9898
if len(username) > 1 or len(password) > 1:
9999
try:
100100
s.login(username, password)
101+
except Exception as e:
102+
if len(password) == 0:
103+
self.logger.info("[WARNING] Auth failed (2). No password provided. Continuing as auth may not be necessary.")
104+
else:
105+
return {
106+
"success": False,
107+
"reason": f"General auth exception: {e}"
108+
}
109+
101110
except smtplib.SMTPAuthenticationError as e:
102111
if len(password) == 0:
103-
self.logger.info("No password provided. Continuing as auth may not be necessary.")
112+
self.logger.info("[WARNING] Auth failed. No password provided. Continuing as auth may not be necessary.")
104113
else:
105114
return {
106115
"success": False,

0 commit comments

Comments
 (0)