diff options
author | Stéphane Wirtel <stephane@wirtel.be> | 2018-01-31 01:02:51 +0100 |
---|---|---|
committer | Ned Deily <nad@python.org> | 2018-01-31 17:01:31 -0500 |
commit | 209108bd6997258948d13f48f2b5a2f1220c1a35 (patch) | |
tree | 284b9ed5aef3f8f920483ac07315d4692940c4e1 /Lib/smtplib.py | |
parent | f5f8a74356e210e49ed2f4dd173ab2ab3a49ecc7 (diff) | |
download | cpython-git-209108bd6997258948d13f48f2b5a2f1220c1a35.tar.gz |
bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addrs (#5451)
Do not pass the name field in the 'from' address in the SMTP envelope.
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-x | Lib/smtplib.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 5e422b704a..b679875fd2 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -933,6 +933,7 @@ class SMTP: from_addr = (msg[header_prefix + 'Sender'] if (header_prefix + 'Sender') in msg else msg[header_prefix + 'From']) + from_addr = email.utils.getaddresses([from_addr])[0][1] if to_addrs is None: addr_fields = [f for f in (msg[header_prefix + 'To'], msg[header_prefix + 'Bcc'], |