-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addrs #5451
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
Conversation
bitdancer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a test, as you know :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Do not include name field in SMTP envelope from address."
Lib/smtplib.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
|
GH-5455 is a backport of this pull request to the 3.6 branch. |
…addr and to_addrs (GH-5451) (#5455) 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 <[email protected]>
…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