Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter
Commits
a01f598e
Commit
a01f598e
authored
5 years ago
by
Stuart D. Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Test case for invalid utf8 bytes in header.
parent
d0d45c5e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/utf8
+6
-0
6 additions, 0 deletions
test/utf8
testsample.py
+17
-0
17 additions, 0 deletions
testsample.py
with
23 additions
and
0 deletions
test/utf8
0 → 100644
+
6
−
0
View file @
a01f598e
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?
This diff is collapsed.
Click to expand it.
testsample.py
+
17
−
0
View file @
a01f598e
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment