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
d01dc65f
Commit
d01dc65f
authored
18 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Use HELO identity if good when MAILFROM is bad.
parent
b703031c
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
+10
-3
10 additions, 3 deletions
bms.py
with
10 additions
and
3 deletions
bms.py
+
10
−
3
View file @
d01dc65f
#!/usr/bin/env python
# A simple milter that has grown quite a bit.
# $Log$
# Revision 1.76 2006/12/30 18:58:53 customdesigned
# Skip reputation/whitelist/blacklist when rejecting on SPF. Add X-Hello-SPF.
#
# 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.
...
...
@@ -813,7 +816,8 @@ class bmsMilter(Milter.Milter):
else
:
rc
=
Milter
.
CONTINUE
# FIXME: parse Received-SPF from trusted_relay for SPF result
res
=
self
.
spf
and
self
.
spf
.
guess
res
=
self
.
spf
and
self
.
spf_guess
hres
=
self
.
spf
and
self
.
spf_helo
# Check whitelist and blacklist
if
auto_whitelist
.
has_key
(
self
.
canon_from
):
if
res
==
'
pass
'
or
self
.
trusted_relay
:
...
...
@@ -834,6 +838,9 @@ class bmsMilter(Milter.Milter):
qual
=
'
SPF
'
elif
res
==
'
pass
'
:
qual
=
'
GUESS
'
elif
hres
==
'
pass
'
:
qual
=
'
HELO
'
domain
=
self
.
spf
.
h
else
:
qual
=
self
.
connectip
try
:
...
...
@@ -983,7 +990,8 @@ class bmsMilter(Milter.Milter):
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
self
.
spf_guess
=
res
self
.
spf_helo
=
hres
if
res
!=
q
.
result
:
self
.
add_header
(
'
X-Guessed-SPF
'
,
res
,
0
)
self
.
spf
=
q
...
...
@@ -1730,7 +1738,6 @@ def main():
Milter
.
set_flags
(
flags
)
socket
.
setdefaulttimeout
(
60
)
milter_log
.
info
(
"
bms milter startup
"
)
sys
.
stdout
.
flush
()
Milter
.
runmilter
(
"
pythonfilter
"
,
socketname
,
timeout
)
milter_log
.
info
(
"
bms milter shutdown
"
)
...
...
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