summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_smtplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_smtplib.py')
-rw-r--r--Lib/test/test_smtplib.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index b6d5b8c..f2e02da 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -831,6 +831,7 @@ class SimSMTPChannel(smtpd.SMTPChannel):
def __init__(self, extra_features, *args, **kw):
self._extrafeatures = ''.join(
[ "250-{0}\r\n".format(x) for x in extra_features ])
+ self.all_received_lines = []
super(SimSMTPChannel, self).__init__(*args, **kw)
# AUTH related stuff. It would be nice if support for this were in smtpd.
@@ -845,6 +846,7 @@ class SimSMTPChannel(smtpd.SMTPChannel):
self.smtp_state = self.COMMAND
self.push('%s %s' % (e.smtp_code, e.smtp_error))
return
+ self.all_received_lines.append(self.received_lines)
super().found_terminator()
@@ -1349,6 +1351,18 @@ class SMTPSimTests(unittest.TestCase):
self.assertEqual(self.serv._addresses['from'], 'michael@example.com')
self.assertEqual(self.serv._addresses['tos'], ['rene@example.com'])
+ def test_lowercase_mail_from_rcpt_to(self):
+ m = 'A test message'
+ smtp = smtplib.SMTP(
+ HOST, self.port, local_hostname='localhost',
+ timeout=support.LOOPBACK_TIMEOUT)
+ self.addCleanup(smtp.close)
+
+ smtp.sendmail('John', 'Sally', m)
+
+ self.assertIn(['mail from:<John> size=14'], self.serv._SMTPchannel.all_received_lines)
+ self.assertIn(['rcpt to:<Sally>'], self.serv._SMTPchannel.all_received_lines)
+
class SimSMTPUTF8Server(SimSMTPServer):