From 6cd80f65a5f2d0bc9e47fc72b932ada994b207e6 Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 9 Jun 1999 15:13:10 +0000 Subject: 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. --- Mailman/pythonlib/smtplib.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Mailman/pythonlib/smtplib.py') diff --git a/Mailman/pythonlib/smtplib.py b/Mailman/pythonlib/smtplib.py index 370182e9f..8cca5908e 100755 --- a/Mailman/pythonlib/smtplib.py +++ b/Mailman/pythonlib/smtplib.py @@ -231,7 +231,10 @@ class SMTP: def putcmd(self, cmd, args=""): """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) def getreply(self): @@ -345,8 +348,8 @@ class SMTP: """SMTP 'mail' command -- begins mail xfer session.""" optionlist = '' if options and self.does_esmtp: - optionlist = string.join(options, ' ') - self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist)) + optionlist = ' ' + string.join(options, ' ') + self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender) ,optionlist)) return self.getreply() def rcpt(self,recip,options=[]): -- cgit v1.2.3-70-g09d2