summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-01-31 20:54:09 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2018-01-31 20:54:09 (GMT)
commit85a92d00bd278022cc00fda6b124c06f614c5ebb (patch)
treeb4984e5843f193af2d34be2278c25dc506bdb48b /Lib/smtplib.py
parentea94fce6960d90fffeeda131e31024617912d231 (diff)
downloadcpython-85a92d00bd278022cc00fda6b124c06f614c5ebb.zip
cpython-85a92d00bd278022cc00fda6b124c06f614c5ebb.tar.gz
cpython-85a92d00bd278022cc00fda6b124c06f614c5ebb.tar.bz2
bpo-32727: smtplib's SMTP.send_message behaves differently with from_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 8d83e4ba7823827bcbc119db887004d5c3a63dc6) Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py1
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'],