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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter
Commits
a2215124
Commit
a2215124
authored
18 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Ban ips with too many bad rcpts on a connection.
parent
e505d2bb
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
+12
-0
12 additions, 0 deletions
bms.py
with
12 additions
and
0 deletions
bms.py
+
12
−
0
View file @
a2215124
#!/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.105 2007/04/13 17:20:09 customdesigned
# Check access_file at startup. Compress rcpt to log.
#
# Revision 1.104 2007/04/05 17:59:07 customdesigned
# Revision 1.104 2007/04/05 17:59:07 customdesigned
# Stop querying gossip server twice.
# Stop querying gossip server twice.
#
#
...
@@ -797,6 +800,15 @@ class bmsMilter(Milter.Milter):
...
@@ -797,6 +800,15 @@ class bmsMilter(Milter.Milter):
self
.
reputation
=
int
(
a
[
-
2
])
self
.
reputation
=
int
(
a
[
-
2
])
self
.
confidence
=
int
(
a
[
-
1
])
self
.
confidence
=
int
(
a
[
-
1
])
self
.
umis
=
umis
self
.
umis
=
umis
# We would like to reject on bad reputation here, but we
# need to give special consideration to postmaster. So
# we have to wait until envrcpt(). Perhaps an especially
# bad reputation could be rejected here.
if
self
.
reputation
<
-
70
and
self
.
confidence
>
5
:
self
.
log
(
'
REJECT: REPUTATION, rcpt to
'
,
to
,
str
)
self
.
setreply
(
'
550
'
,
'
5.7.1
'
,
'
Your domain has been sending nothing but spam
'
)
return
Milter
.
REJECT
except
:
except
:
gossip
=
None
gossip
=
None
raise
raise
...
...
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