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
95b24f76
Commit
95b24f76
authored
Jul 17, 2005
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Log as well as use extended result for best guess.
parent
db0f1095
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
+5
-4
5 additions, 4 deletions
bms.py
with
5 additions
and
4 deletions
bms.py
+
5
−
4
View file @
95b24f76
#!/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.17 2005/07/15 20:25:36 customdesigned
# Use extended results processing for best_guess.
#
# Revision 1.16 2005/07/14 03:23:33 customdesigned
# Revision 1.16 2005/07/14 03:23:33 customdesigned
# Make SES package optional. Initial honeypot support.
# Make SES package optional. Initial honeypot support.
#
#
...
@@ -693,7 +696,6 @@ class bmsMilter(Milter.Milter):
...
@@ -693,7 +696,6 @@ class bmsMilter(Milter.Milter):
q
.
set_default_explanation
(
q
.
set_default_explanation
(
'
SPF fail: see http://spf.pobox.com/why.html?sender=%s&ip=%s
'
%
(
q
.
s
,
q
.
i
))
'
SPF fail: see http://spf.pobox.com/why.html?sender=%s&ip=%s
'
%
(
q
.
s
,
q
.
i
))
res
,
code
,
txt
=
q
.
check
()
res
,
code
,
txt
=
q
.
check
()
ores
=
res
# original result
if
res
in
(
'
none
'
,
'
softfail
'
):
if
res
in
(
'
none
'
,
'
softfail
'
):
if
self
.
mailfrom
!=
'
<>
'
:
if
self
.
mailfrom
!=
'
<>
'
:
# check hello name via spf
# check hello name via spf
...
@@ -723,11 +725,10 @@ class bmsMilter(Milter.Milter):
...
@@ -723,11 +725,10 @@ class bmsMilter(Milter.Milter):
res
,
code
,
txt
=
q
.
best_guess
(
'
v=spf1 a/24 mx/24
'
)
res
,
code
,
txt
=
q
.
best_guess
(
'
v=spf1 a/24 mx/24
'
)
else
:
else
:
res
,
code
,
txt
=
q
.
best_guess
()
res
,
code
,
txt
=
q
.
best_guess
()
ores
=
res
# original result
receiver
+=
'
: guessing
'
if
q
.
perm_error
:
if
q
.
perm_error
:
res
,
code
,
txt
=
q
.
perm_error
.
ext
# extended result
res
,
code
,
txt
=
q
.
perm_error
.
ext
# extended result
txt
=
'
EXT:
'
+
txt
txt
=
'
EXT:
'
+
txt
receiver
+=
'
: guessing
'
if
self
.
missing_ptr
and
res
in
(
'
neutral
'
,
'
none
'
)
and
hres
!=
'
pass
'
:
if
self
.
missing_ptr
and
res
in
(
'
neutral
'
,
'
none
'
)
and
hres
!=
'
pass
'
:
if
spf_reject_noptr
:
if
spf_reject_noptr
:
self
.
log
(
'
REJECT: no PTR, HELO or SPF
'
)
self
.
log
(
'
REJECT: no PTR, HELO or SPF
'
)
...
@@ -783,7 +784,7 @@ class bmsMilter(Milter.Milter):
...
@@ -783,7 +784,7 @@ class bmsMilter(Milter.Milter):
self
.
log
(
'
TEMPFAIL: SPF %s %i %s
'
%
(
res
,
code
,
txt
))
self
.
log
(
'
TEMPFAIL: SPF %s %i %s
'
%
(
res
,
code
,
txt
))
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
(
o
res
,
receiver
))
self
.
add_header
(
'
Received-SPF
'
,
q
.
get_header
(
res
,
receiver
))
return
Milter
.
CONTINUE
return
Milter
.
CONTINUE
# hide_path causes a copy of the message to be saved - until we
# hide_path causes a copy of the message to be saved - until we
...
...
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
sign in
to comment