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
a36dcbfc
Commit
a36dcbfc
authored
8 years ago
by
Stuart D. Gathman
Browse files
Options
Downloads
Patches
Plain Diff
All unittests pass in py2 and py3!
parent
626d5ae2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Milter/dynip.py
+2
-2
2 additions, 2 deletions
Milter/dynip.py
Milter/utils.py
+1
-1
1 addition, 1 deletion
Milter/utils.py
testutils.py
+1
-1
1 addition, 1 deletion
testutils.py
with
4 additions
and
4 deletions
Milter/dynip.py
+
2
−
2
View file @
a36dcbfc
...
@@ -54,11 +54,11 @@ def is_dynip(host,addr):
...
@@ -54,11 +54,11 @@ def is_dynip(host,addr):
if
host
.
find
(
addr
)
>=
0
:
return
True
if
host
.
find
(
addr
)
>=
0
:
return
True
if
addr
.
find
(
'
:
'
)
>=
0
:
return
False
# IP6
if
addr
.
find
(
'
:
'
)
>=
0
:
return
False
# IP6
a
=
addr
.
split
(
'
.
'
)
a
=
addr
.
split
(
'
.
'
)
ia
=
map
(
int
,
a
)
ia
=
list
(
map
(
int
,
a
)
)
h
=
host
h
=
host
m
=
ip3
.
findall
(
host
)
m
=
ip3
.
findall
(
host
)
if
m
:
if
m
:
g
=
map
(
int
,
m
)[:
4
]
g
=
list
(
map
(
int
,
m
)
)
[:
4
]
ia3
=
(
ia
[
1
:],
ia
[:
3
])
ia3
=
(
ia
[
1
:],
ia
[:
3
])
if
g
[
-
3
:]
in
ia3
:
return
True
if
g
[
-
3
:]
in
ia3
:
return
True
if
g
[
0
]
==
ia
[
3
]
and
g
[
1
:
3
]
==
ia
[:
2
]:
return
True
if
g
[
0
]
==
ia
[
3
]
and
g
[
1
:
3
]
==
ia
[:
2
]:
return
True
...
...
This diff is collapsed.
Click to expand it.
Milter/utils.py
+
1
−
1
View file @
a36dcbfc
...
@@ -133,7 +133,7 @@ def parseaddr(t):
...
@@ -133,7 +133,7 @@ def parseaddr(t):
>>>
parseaddr
(
'
God@heaven <@hop1.org,@hop2.net:jeff@spec.org>
'
)
>>>
parseaddr
(
'
God@heaven <@hop1.org,@hop2.net:jeff@spec.org>
'
)
(
'
God@heaven
'
,
'
jeff@spec.org
'
)
(
'
God@heaven
'
,
'
jeff@spec.org
'
)
>>>
parseaddr
(
'
Real Name ((comment)) <addr...@example.com>
'
)
>>>
parseaddr
(
'
Real Name ((comment)) <addr...@example.com>
'
)
(
'
Real Name
'
,
'
addr...@example.com
'
)
(
'
Real Name
(comment)
'
,
'
addr...@example.com
'
)
>>>
parseaddr
(
'
a(WRONG)@b
'
)
>>>
parseaddr
(
'
a(WRONG)@b
'
)
(
'
WRONG
'
,
'
a@b
'
)
(
'
WRONG
'
,
'
a@b
'
)
"""
"""
...
...
This diff is collapsed.
Click to expand it.
testutils.py
+
1
−
1
View file @
a36dcbfc
...
@@ -43,7 +43,7 @@ class AddrCacheTestCase(unittest.TestCase):
...
@@ -43,7 +43,7 @@ class AddrCacheTestCase(unittest.TestCase):
def
testParseHeader
(
self
):
def
testParseHeader
(
self
):
s
=
'
=?UTF-8?B?TGFzdCBGZXcgQ29sZHBsYXkgQWxidW0gQXJ0d29ya3MgQXZhaWxhYmxlAA?=
'
s
=
'
=?UTF-8?B?TGFzdCBGZXcgQ29sZHBsYXkgQWxidW0gQXJ0d29ya3MgQXZhaWxhYmxlAA?=
'
h
=
Milter
.
utils
.
parse_header
(
s
)
h
=
Milter
.
utils
.
parse_header
(
s
)
self
.
assertEqual
(
h
,
'
Last Few Coldplay Album Artworks Available
\x00
'
)
self
.
assertEqual
(
h
,
b
'
Last Few Coldplay Album Artworks Available
\x00
'
)
def
suite
():
def
suite
():
s
=
unittest
.
makeSuite
(
AddrCacheTestCase
,
'
test
'
)
s
=
unittest
.
makeSuite
(
AddrCacheTestCase
,
'
test
'
)
...
...
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