In rcpt(), avoid a space after the TO: address when the option list is
empty. Make sure there is a space when there are options.
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 264eafb..ebaf7f2 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -294,8 +294,8 @@
"""SMTP 'rcpt' command -- indicates 1 recipient for this mail."""
optionlist = ''
if options and self.does_esmtp:
- optionlist = string.join(options, ' ')
- self.putcmd("rcpt","TO:%s %s" % (quoteaddr(recip),optionlist))
+ optionlist = ' ' + string.join(options, ' ')
+ self.putcmd("rcpt","TO:%s%s" % (quoteaddr(recip),optionlist))
return self.getreply()
def data(self,msg):