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
b703031c
Commit
b703031c
authored
18 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Skip reputation/whitelist/blacklist when rejecting on SPF. Add X-Hello-SPF.
parent
1bc0a4fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bms.py
+8
-0
8 additions, 0 deletions
bms.py
with
8 additions
and
0 deletions
bms.py
+
8
−
0
View file @
b703031c
#!/usr/bin/env python
#!/usr/bin/env python
# A simple milter that has grown quite a bit.
# A simple milter that has grown quite a bit.
# $Log$
# $Log$
# Revision 1.75 2006/12/28 01:54:32 customdesigned
# Reject on bad_reputation or blacklist and nodspam. Match valid helo like
# PTR for guessed SPF pass.
#
# Revision 1.74 2006/12/19 00:59:30 customdesigned
# Revision 1.74 2006/12/19 00:59:30 customdesigned
# Add archive option to wiretap.
# Add archive option to wiretap.
#
#
...
@@ -805,6 +809,7 @@ class bmsMilter(Milter.Milter):
...
@@ -805,6 +809,7 @@ class bmsMilter(Milter.Milter):
if
not
(
self
.
internal_connection
or
self
.
trusted_relay
)
\
if
not
(
self
.
internal_connection
or
self
.
trusted_relay
)
\
and
self
.
connectip
and
spf
:
and
self
.
connectip
and
spf
:
rc
=
self
.
check_spf
()
rc
=
self
.
check_spf
()
if
rc
!=
Milter
.
CONTINUE
:
return
rc
else
:
else
:
rc
=
Milter
.
CONTINUE
rc
=
Milter
.
CONTINUE
# FIXME: parse Received-SPF from trusted_relay for SPF result
# FIXME: parse Received-SPF from trusted_relay for SPF result
...
@@ -864,6 +869,7 @@ class bmsMilter(Milter.Milter):
...
@@ -864,6 +869,7 @@ class bmsMilter(Milter.Milter):
res
,
code
,
txt
=
q
.
perm_error
.
ext
# extended (lax processing) result
res
,
code
,
txt
=
q
.
perm_error
.
ext
# extended (lax processing) result
txt
=
'
EXT:
'
+
txt
txt
=
'
EXT:
'
+
txt
p
=
SPFPolicy
(
q
.
s
)
p
=
SPFPolicy
(
q
.
s
)
hres
=
None
if
res
not
in
(
'
pass
'
,
'
error
'
,
'
temperror
'
):
if
res
not
in
(
'
pass
'
,
'
error
'
,
'
temperror
'
):
if
self
.
mailfrom
!=
'
<>
'
:
if
self
.
mailfrom
!=
'
<>
'
:
# check hello name via spf unless spf pass
# check hello name via spf unless spf pass
...
@@ -975,6 +981,8 @@ class bmsMilter(Milter.Milter):
...
@@ -975,6 +981,8 @@ class bmsMilter(Milter.Milter):
self
.
setreply
(
str
(
code
),
'
4.3.0
'
,
txt
)
self
.
setreply
(
str
(
code
),
'
4.3.0
'
,
txt
)
return
Milter
.
TEMPFAIL
return
Milter
.
TEMPFAIL
self
.
add_header
(
'
Received-SPF
'
,
q
.
get_header
(
q
.
result
,
receiver
),
0
)
self
.
add_header
(
'
Received-SPF
'
,
q
.
get_header
(
q
.
result
,
receiver
),
0
)
if
hres
and
q
.
h
!=
q
.
o
:
self
.
add_header
(
'
X-Hello-SPF
'
,
hres
,
0
)
q
.
guess
=
res
q
.
guess
=
res
if
res
!=
q
.
result
:
if
res
!=
q
.
result
:
self
.
add_header
(
'
X-Guessed-SPF
'
,
res
,
0
)
self
.
add_header
(
'
X-Guessed-SPF
'
,
res
,
0
)
...
...
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