Wasn't reading banned_ips

This commit is contained in:
Stuart Gathman
2008-09-09 23:08:16 +00:00
parent d86b9f7312
commit 93e9644574
+5
View File
@@ -1,6 +1,9 @@
#!/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):
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():
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))