diff -r 9cccfaa6b534 Lib/test/test_smtpd.py --- a/Lib/test/test_smtpd.py Mon Mar 12 22:59:49 2012 +0100 +++ b/Lib/test/test_smtpd.py Tue Mar 13 07:32:36 2012 +0900 @@ -166,6 +166,11 @@ self.assertEqual(self.channel.socket.last, b'503 Error: nested MAIL command\r\n') + def test_HELO_EHLO_before_mail_transaction(self): + self.write_line(b'MAIL from:') + self.assertEqual(self.channel.socket.last, + b'503 Bad sequence of commands') + def test_need_RCPT(self): self.write_line(b'MAIL From:eggs@example') self.write_line(b'DATA')