summaryrefslogtreecommitdiff
path: root/Lib/test/test_smtplib.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-06-09 15:21:02 -0400
committerR David Murray <rdmurray@bitdance.com>2011-06-09 15:21:02 -0400
commit0a9f16b62738dd5ab14907a870a18f8b81a2058a (patch)
treec793508c600a6b1c048802f647071afa015dc346 /Lib/test/test_smtplib.py
parentbf353aadf274b898a515e81c2b1d63fbac83feca (diff)
parent0f663d07e669c39ce9a7ddfa71ed1293379a358e (diff)
downloadcpython-git-0a9f16b62738dd5ab14907a870a18f8b81a2058a.tar.gz
merge #12283: Fixed regression in smtplib quoting of leading dots in DATA.
Diffstat (limited to 'Lib/test/test_smtplib.py')
-rw-r--r--Lib/test/test_smtplib.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index dfe08fa16a..120470756d 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -278,6 +278,21 @@ class DebuggingServerTests(unittest.TestCase):
mexpect = '%s%s\n%s' % (MSG_BEGIN, m.decode('ascii'), MSG_END)
self.assertEqual(self.output.getvalue(), mexpect)
+ def testSendNeedingDotQuote(self):
+ # Issue 12283
+ m = '.A test\n.mes.sage.'
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
+ smtp.sendmail('John', 'Sally', m)
+ # XXX (see comment in testSend)
+ time.sleep(0.01)
+ smtp.quit()
+
+ self.client_evt.set()
+ self.serv_evt.wait()
+ self.output.flush()
+ mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END)
+ self.assertEqual(self.output.getvalue(), mexpect)
+
def testSendMessage(self):
m = email.mime.text.MIMEText('A test message')
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)