summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorMatthieu Caneill <matthieucan@users.noreply.github.com>2023-07-22 14:46:59 (GMT)
committerGitHub <noreply@github.com>2023-07-22 14:46:59 (GMT)
commit3782def5a2b4d24ab5d356f89da181e99a9a59b2 (patch)
tree83c72fc5226091985ae4f1a7cd261029f1284159 /Lib/smtplib.py
parentd228825e08883fc13f35eb91435f95d32524931c (diff)
downloadcpython-3782def5a2b4d24ab5d356f89da181e99a9a59b2.zip
cpython-3782def5a2b4d24ab5d356f89da181e99a9a59b2.tar.gz
cpython-3782def5a2b4d24ab5d356f89da181e99a9a59b2.tar.bz2
gh-65495: Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP` (#107019)
Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP` SMTP commands are case-insensitive. `smtplib` uses lowercase commands, however it writes `mail FROM` and `rcpt TO`, lacking consistency.
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 18c9174..b3cc68a 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -542,7 +542,7 @@ class SMTP:
raise SMTPNotSupportedError(
'SMTPUTF8 not supported by server')
optionlist = ' ' + ' '.join(options)
- self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))
+ self.putcmd("mail", "from:%s%s" % (quoteaddr(sender), optionlist))
return self.getreply()
def rcpt(self, recip, options=()):
@@ -550,7 +550,7 @@ class SMTP:
optionlist = ''
if options and self.does_esmtp:
optionlist = ' ' + ' '.join(options)
- self.putcmd("rcpt", "TO:%s%s" % (quoteaddr(recip), optionlist))
+ self.putcmd("rcpt", "to:%s%s" % (quoteaddr(recip), optionlist))
return self.getreply()
def data(self, msg):