gh-76984: Handle DATA correctly for LMTP with multiple RCPT#18896
gh-76984: Handle DATA correctly for LMTP with multiple RCPT#18896middagj wants to merge 1 commit intopython:mainfrom
Conversation
5afbc30 to
a6a358d
Compare
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
1c8c94a to
eaa7e88
Compare
eaa7e88 to
1bf8b36
Compare
1bf8b36 to
e064a83
Compare
34a7ae0 to
d6997bb
Compare
|
@picnixz what is missing to get this PR merged at some point in time? |
|
I just changed the title of the PR as it was against bpo IDs (which were moved to GH issues 3y ago I think) so I didn't look at it. I can have a look at that PR and review it though! |
picnixz
left a comment
There was a problem hiding this comment.
I'll need to review more carefully this but, assuming that this is a new feature and not just a bugfix:
- This will need a What's New entry.
- The docs need some updates (if we're documenting exceptions for instance, we also need to add this new exception to the docs)
I'd treat this as a new feature as it's a behavioral change but I need to get the context and the RFC before that so this is just a preliminary review
|
Oh and if @bitdancer has time, they can have a look at this one before me since they are more knowledgable (I don't have much time for email and http related stuff now) |
d6997bb to
607ffa2
Compare
|
This PR is stale because it has been open for 30 days with no activity. |
…o-32803) Conform RFC 2033, the LMTP protocol gives for each successful recipient a reply. The smtplib only reads one. This gives problems sending more than one message with multiple recipients in a connection.
607ffa2 to
700f408
Compare
Conform RFC 2033, the LMTP protocol gives for each successful recipient a reply.
The smtplib only reads one. This gives problems sending more than one message
with multiple recipients in a connection. See https://bugs.python.org/issue32803
To be backwards compatible, I added a new method
multi_datato support aDATAcommand with multiple replies. I modeled it afterdataand wanted to keep the error handling in thesendmailmethod. Because we need to close the connection once we receive a 421, I chose to yield the results instead of returning a list. Similar to the multiple RCTP solution, I only raise an Exception if all recipients fail.I am not sure about the naming of
LMTPDataError. It breaks the structure of all errors beginning with LMTP, but it is really a specific LMTP error. An alternative could beSMTPMultiDataError.I also fixed the assertion in
test_421_from_data_cmd. I think it should comparerset_countand notrcpt_count. Thercpt_countis only modified ifrcpt_responseis used. The purpose of the test is to be sure the method closed instead of reset.https://bugs.python.org/issue32803