Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop swallowing dict returned by stdlib sendmail() #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nandoflorestan
Copy link

@nandoflorestan nandoflorestan commented Mar 24, 2021

One quirk of the sendmail method of Python stdlib is that it may return a dictionary of errors. This can happen when there are multiple recipients in the message being sent. The docs tell us:

(...) if this method does not raise an exception, then someone should get your mail. If this method does not raise an exception, it returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server.

It is necessary to allow that dictionary to reach the application, since it is the only code that knows how to deal with that situation. This is so clearly the case that the library pyramid_mailer, which reuses repoze.sendmail, assumes there's a return value and does return it to the application.

Existing tests pass but I did not add a new test. If you think I should, please let me know.

@nandoflorestan
Copy link
Author

Hello?

@nandoflorestan
Copy link
Author

One year later, wondering if I could get some attention in this PR.

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