Skip to content

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