diff options
author | Stéphane Wirtel <stephane@wirtel.be> | 2018-01-31 00:02:51 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2018-01-31 00:02:51 (GMT) |
commit | 8d83e4ba7823827bcbc119db887004d5c3a63dc6 (patch) | |
tree | 91da858d47025edb701f9d165cfbf6383f984788 /Lib/smtplib.py | |
parent | 1e17d4aaff5c7ca972bab437949d2bb51c5b30f7 (diff) | |
download | cpython-8d83e4ba7823827bcbc119db887004d5c3a63dc6.zip cpython-8d83e4ba7823827bcbc119db887004d5c3a63dc6.tar.gz cpython-8d83e4ba7823827bcbc119db887004d5c3a63dc6.tar.bz2 |
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 5e422b7..b679875 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'], |