mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Patch by Per Cederqvist:
I've found two places where smtplib.py sends an extra trailing space on command lines to the SMTP server. I don't know if this ever causes any problems, but I'd prefer to be on the safe side. The enclosed patch removes the extra space.
This commit is contained in:
parent
4727456d46
commit
db23d3dbf7
1 changed files with 6 additions and 3 deletions
|
@ -231,7 +231,10 @@ class SMTP:
|
||||||
|
|
||||||
def putcmd(self, cmd, args=""):
|
def putcmd(self, cmd, args=""):
|
||||||
"""Send a command to the server."""
|
"""Send a command to the server."""
|
||||||
str = '%s %s%s' % (cmd, args, CRLF)
|
if args == "":
|
||||||
|
str = '%s%s' % (cmd, CRLF)
|
||||||
|
else:
|
||||||
|
str = '%s %s%s' % (cmd, args, CRLF)
|
||||||
self.send(str)
|
self.send(str)
|
||||||
|
|
||||||
def getreply(self):
|
def getreply(self):
|
||||||
|
@ -345,8 +348,8 @@ class SMTP:
|
||||||
"""SMTP 'mail' command -- begins mail xfer session."""
|
"""SMTP 'mail' command -- begins mail xfer session."""
|
||||||
optionlist = ''
|
optionlist = ''
|
||||||
if options and self.does_esmtp:
|
if options and self.does_esmtp:
|
||||||
optionlist = string.join(options, ' ')
|
optionlist = ' ' + string.join(options, ' ')
|
||||||
self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist))
|
self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender) ,optionlist))
|
||||||
return self.getreply()
|
return self.getreply()
|
||||||
|
|
||||||
def rcpt(self,recip,options=[]):
|
def rcpt(self,recip,options=[]):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue