Skip to content
Snippets Groups Projects
Commit 93e96445 authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Wasn't reading banned_ips

parent d86b9f73
No related branches found
No related tags found
No related merge requests found
#!/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.127 2008/08/25 18:32:22 customdesigned
# Handle missing gossip_node so self tests pass.
#
# Revision 1.126 2008/08/18 17:47:57 customdesigned # Revision 1.126 2008/08/18 17:47:57 customdesigned
# Log rcpt for SRS rejections. # Log rcpt for SRS rejections.
# #
...@@ -1012,6 +1015,7 @@ class bmsMilter(Milter.Milter): ...@@ -1012,6 +1015,7 @@ class bmsMilter(Milter.Milter):
if self.missing_ptr and ores == 'none' and res != 'pass' \ if self.missing_ptr and ores == 'none' and res != 'pass' \
and hres != 'pass': and hres != 'pass':
# this bad boy has no credentials whatsoever # this bad boy has no credentials whatsoever
res = 'none'
policy = p.getNonePolicy() policy = p.getNonePolicy()
if policy in ('CBV','DNS'): if policy in ('CBV','DNS'):
self.offenses = 3 # ban ip if any bad recipient self.offenses = 3 # ban ip if any bad recipient
...@@ -1915,6 +1919,7 @@ def main(): ...@@ -1915,6 +1919,7 @@ def main():
return return
try: try:
from glob import glob from glob import glob
global banned_ips
banned_ips = set(addr2bin(ip) banned_ips = set(addr2bin(ip)
for fn in glob('banned_ips*') for fn in glob('banned_ips*')
for ip in open(fn)) for ip in open(fn))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment