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
2fa952e1
Commit
2fa952e1
authored
8 years ago
by
Stuart D. Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Make test cases work. (Previous commit incomplete)
parent
381e906b
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Milter/__init__.py
+7
-5
7 additions, 5 deletions
Milter/__init__.py
Milter/test.py
+2
-1
2 additions, 1 deletion
Milter/test.py
sample.py
+1
-0
1 addition, 0 deletions
sample.py
with
10 additions
and
6 deletions
Milter/__init__.py
+
7
−
5
View file @
2fa952e1
...
...
@@ -185,13 +185,15 @@ def noreply(func):
# If some or all of these are unused, the bandwidth can be saved
# by listing the ones that are used.
# @since 1.0.2
def
symlist
(
func
,
*
syms
):
if
func
.
__name__
not
in
MACRO_CALLBACKS
:
raise
ValueError
(
'
@symlist applied to non-symlist method:
'
+
func
.
__name__
)
def
symlist
(
*
syms
):
if
len
(
syms
)
>
5
:
raise
ValueError
(
'
@symlist limited to 5 macros by MTA:
'
+
func
.
__name__
)
def
setsyms
(
func
):
if
func
.
__name__
not
in
MACRO_CALLBACKS
:
raise
ValueError
(
'
@symlist applied to non-symlist method:
'
+
func
.
__name__
)
func
.
_symlist
=
syms
return
func
return
setsyms
## Disabled action exception.
# set_flags() can tell the MTA that this application will not use certain
...
...
This diff is collapsed.
Click to expand it.
Milter/test.py
+
2
−
1
View file @
2fa952e1
...
...
@@ -120,7 +120,7 @@ class TestBase(object):
self
.
_reply
=
(
rcode
,
xcode
)
+
msg
def
setsymlist
(
self
,
stage
,
macros
):
if
not
self
.
_actions
&
SETSYMLIST
:
if
not
self
.
_actions
&
Milter
.
SETSYMLIST
:
raise
DisabledAction
(
"
SETSYMLIST
"
)
if
self
.
_stage
!=
-
1
:
raise
RuntimeError
(
"
setsymlist may only be called from negotiate
"
)
...
...
@@ -220,6 +220,7 @@ class TestBase(object):
def
connect
(
self
,
host
=
'
localhost
'
,
helo
=
'
spamrelay
'
,
ip
=
'
1.2.3.4
'
):
self
.
_body
=
None
self
.
_bodyreplaced
=
False
self
.
_setctx
(
None
)
opts
=
[
Milter
.
CURR_ACTS
,
~
0
,
0
,
0
]
self
.
_stage
=
-
1
rc
=
self
.
negotiate
(
opts
)
...
...
This diff is collapsed.
Click to expand it.
sample.py
+
1
−
0
View file @
2fa952e1
...
...
@@ -47,6 +47,7 @@ class sampleMilter(Milter.Milter):
self
.
mailfrom
=
f
self
.
bodysize
=
0
self
.
user
=
self
.
getsymval
(
'
{auth_authen}
'
)
self
.
auth_type
=
self
.
getsymval
(
'
{auth_type}
'
)
if
self
.
user
:
self
.
log
(
"
user
"
,
self
.
user
,
"
sent mail from
"
,
f
,
str
)
else
:
...
...
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