Skip to content

Commit ce81c30

Browse files
committed
Quit SMTP connection on any initialization failure
Broaden the except clause from SMTPAuthenticationError to Exception so the connection is cleaned up when starttls() or ehlo_or_helo_if_needed() fails as well. Fixes #179
1 parent d76321a commit ce81c30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

emails/backend/smtp/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, parent, **kwargs):
2727

2828
try:
2929
self.initialize()
30-
except smtplib.SMTPAuthenticationError:
30+
except Exception:
3131
self.quit()
3232
raise
3333

0 commit comments

Comments
 (0)