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
16bfe5d4
Commit
16bfe5d4
authored
13 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Exceptions on unsupported result code for callback decorators.
parent
70d19001
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Milter/__init__.py
+12
-3
12 additions, 3 deletions
Milter/__init__.py
pymilter.spec
+4
-0
4 additions, 0 deletions
pymilter.spec
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
17 additions
and
4 deletions
Milter/__init__.py
+
12
−
3
View file @
16bfe5d4
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
# Copyright 2001,2009 Business Management Systems, Inc.
# Copyright 2001,2009 Business Management Systems, Inc.
# This code is under the GNU General Public License. See COPYING for details.
# This code is under the GNU General Public License. See COPYING for details.
__version__
=
'
0.9.
5
'
__version__
=
'
0.9.
7
'
import
os
import
os
import
milter
import
milter
...
@@ -137,7 +137,12 @@ def nocallback(func):
...
@@ -137,7 +137,12 @@ def nocallback(func):
except
KeyError
:
except
KeyError
:
raise
ValueError
(
raise
ValueError
(
'
@nocallback applied to non-optional method:
'
+
func
.
__name__
)
'
@nocallback applied to non-optional method:
'
+
func
.
__name__
)
return
func
def
wrapper
(
self
,
*
args
):
if
func
(
self
,
*
args
)
!=
CONTINUE
:
raise
RuntimeError
(
'
%s return code must be CONTINUE with @nocallback
'
%
func
.
__name__
)
return
CONTINUE
return
wrapper
## Function decorator to disable callback reply.
## Function decorator to disable callback reply.
# If the MTA supports it, tells the MTA not to wait for a reply from
# If the MTA supports it, tells the MTA not to wait for a reply from
...
@@ -154,7 +159,11 @@ def noreply(func):
...
@@ -154,7 +159,11 @@ def noreply(func):
'
@noreply applied to non-optional method:
'
+
func
.
__name__
)
'
@noreply applied to non-optional method:
'
+
func
.
__name__
)
def
wrapper
(
self
,
*
args
):
def
wrapper
(
self
,
*
args
):
rc
=
func
(
self
,
*
args
)
rc
=
func
(
self
,
*
args
)
if
self
.
_protocol
&
nr_mask
:
return
NOREPLY
if
self
.
_protocol
&
nr_mask
:
if
rc
!=
CONTINUE
:
raise
RuntimeError
(
'
%s return code must be CONTINUE with @noreply
'
%
func
.
__name__
)
return
NOREPLY
return
rc
return
rc
wrapper
.
milter_protocol
=
nr_mask
wrapper
.
milter_protocol
=
nr_mask
return
wrapper
return
wrapper
...
...
This diff is collapsed.
Click to expand it.
pymilter.spec
+
4
−
0
View file @
16bfe5d4
...
@@ -75,6 +75,10 @@ chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
...
@@ -75,6 +75,10 @@ chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT
%changelog
%changelog
* Sat Feb 25 2012 Stuart Gathman <stuart@bmsi.com> 0.9.7-1
- Raise RuntimeError when result != CONTINUE for @noreply and @nocallback
- Remove redundant table in miltermodule
* Sat Feb 25 2012 Stuart Gathman <stuart@bmsi.com> 0.9.6-1
* Sat Feb 25 2012 Stuart Gathman <stuart@bmsi.com> 0.9.6-1
- Raise ValueError on unescaped '%' passed to setreply
- Raise ValueError on unescaped '%' passed to setreply
- Grace time at end of Greylist window
- Grace time at end of Greylist window
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
16bfe5d4
...
@@ -13,7 +13,7 @@ libs = ["milter"]
...
@@ -13,7 +13,7 @@ libs = ["milter"]
libdirs
=
[
"
/usr/lib/libmilter
"
]
# needed for Debian
libdirs
=
[
"
/usr/lib/libmilter
"
]
# needed for Debian
# NOTE: importing Milter to obtain version fails when milter.so not built
# NOTE: importing Milter to obtain version fails when milter.so not built
setup
(
name
=
"
pymilter
"
,
version
=
'
0.9.
6
'
,
setup
(
name
=
"
pymilter
"
,
version
=
'
0.9.
7
'
,
description
=
"
Python interface to sendmail milter API
"
,
description
=
"
Python interface to sendmail milter API
"
,
long_description
=
"""
\
long_description
=
"""
\
This is a python extension module to enable python scripts to
This is a python extension module to enable python scripts to
...
...
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