Skip to content
Snippets Groups Projects
Commit a01f598e authored by Stuart D. Gathman's avatar Stuart D. Gathman
Browse files

Test case for invalid utf8 bytes in header.

parent d0d45c5e
Branches
No related tags found
No related merge requests found
From the-concourse-on-high Sat Feb 2 13:01:43 2019
Date: Sat, 02 Feb 2019 19:48:56 +0100
To: stuart@[IPv6:fcd9:7f8a:e050:4b48:7fd6:7fa:5509:6e26]
Subject: qq.com
Does you receive this email?
......@@ -21,6 +21,23 @@ class BMSMilterTestCase(unittest.TestCase):
self.zf.close()
self.zf = None
def testHeader(self,fname='utf8'):
ctx = TestCtx()
Milter.factory = sample.sampleMilter
ctx._setsymval('{auth_authen}','batman')
ctx._setsymval('{auth_type}','batcomputer')
ctx._setsymval('j','mailhost')
rc = ctx._connect()
self.assertTrue(rc == Milter.CONTINUE)
with open('test/'+fname) as fp:
rc = ctx._feedFile(fp)
milter = ctx.getpriv()
self.assertFalse(ctx._bodyreplaced,"Message body not replaced")
fp = ctx._body
with open('test/'+fname+".tstout","wb") as ofp:
ofp.write(fp.getvalue())
ctx._close()
def testCtx(self,fname='virus1'):
ctx = TestCtx()
Milter.factory = sample.sampleMilter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment