bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addrs#5451
Conversation
bitdancer
left a comment
There was a problem hiding this comment.
Needs a test, as you know :)
There was a problem hiding this comment.
"Do not include name field in SMTP envelope from address."
Lib/smtplib.py
Outdated
There was a problem hiding this comment.
SInce there's only one, you don't need the list comprehension:
from_addr = email.utils.getaddresses([from_addr])[0][1]
There was a problem hiding this comment.
@bitdancer about your solution, I like it and that was my first solution, but I was thinking about one thing, I didn't see in the code an section where you have this kind of access to the item [0][1] but if you agree with that, I am going to fix it.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Lib/test/test_smtplib.py
Outdated
There was a problem hiding this comment.
I would name this "test_name_field_not_included_in_envelope_addresses", and check the addresses seen by the server. That means changing SimSMTPServer's process_message method to record the from and to addresses so you can check them in the test method.
…addr and to_addrs Avoid to set the SMTPUTF8 flag when the sender name contains a non-ascii character. Patch by Stéphane Wirtel
|
Just updated with your remarks,
Hope it is fine for you
|
|
@bitdancer: Please replace |
|
Thanks @matrixise for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
…addr and to_addrs (pythonGH-5451) Do not pass the name field in the 'from' address in the SMTP envelope. (cherry picked from commit 8d83e4b) Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
|
GH-5455 is a backport of this pull request to the 3.6 branch. |
…addr and to_addrs (python#5451) Do not pass the name field in the 'from' address in the SMTP envelope.
Avoid to set the SMTPUTF8 flag when the sender name contains a non-ascii
character. Patch by Stéphane Wirtel
https://bugs.python.org/issue32727