Skip to content

Conversation

@codeZeilen
Copy link

EmailSender already does quite a good job of gracefully quitting the SMTP connection when an error occurs. However, in case the error occurs during get_server (e.g. an authentication failure), the connection is not properly terminated.

This PR wraps get_server in an exception handler that catches such exceptions and quits the connection. Keeping the connection open (until the socket is closed by GC) is not necessary as users can not access it anymore, as it is not stored in the EmailSender instance.

(Found while testing Red Mail in RosettaTest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant