mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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.
This commit is contained in:
parent
d228825e08
commit
3782def5a2
3 changed files with 17 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue