Test case for invalid utf8 bytes in header.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user