mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
merge #12283: Fixed regression in smtplib quoting of leading dots in DATA.
This commit is contained in:
commit
0a9f16b627
3 changed files with 18 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue