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.
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 @@
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'],