Don't reset greylist timer on early retries.
This commit is contained in:
+3
-2
@@ -52,8 +52,9 @@ class Greylist(object):
|
|||||||
r = Record()
|
r = Record()
|
||||||
elif now < r.firstseen + self.greylist_time:
|
elif now < r.firstseen + self.greylist_time:
|
||||||
# still greylisted
|
# still greylisted
|
||||||
log.debug('Reset greylist: %s',key)
|
log.debug('Early greylist: %s',key)
|
||||||
r = Record()
|
#r = Record()
|
||||||
|
r.lastseen = now
|
||||||
elif r.cnt or now < r.firstseen + self.greylist_expire:
|
elif r.cnt or now < r.firstseen + self.greylist_expire:
|
||||||
# in greylist window or active
|
# in greylist window or active
|
||||||
r.lastseen = now
|
r.lastseen = now
|
||||||
|
|||||||
@@ -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.131 2008/10/08 04:57:28 customdesigned
|
||||||
|
# Greylisting
|
||||||
|
#
|
||||||
# Revision 1.130 2008/10/02 03:19:00 customdesigned
|
# Revision 1.130 2008/10/02 03:19:00 customdesigned
|
||||||
# Delay strike3 REJECT and don't reject if whitelisted.
|
# Delay strike3 REJECT and don't reject if whitelisted.
|
||||||
# Recognize vacation messages as autoreplies.
|
# Recognize vacation messages as autoreplies.
|
||||||
@@ -765,6 +768,7 @@ class bmsMilter(Milter.Milter):
|
|||||||
if ip not in banned_ips:
|
if ip not in banned_ips:
|
||||||
banned_ips.add(ip)
|
banned_ips.add(ip)
|
||||||
print >>open('banned_ips','a'),self.connectip
|
print >>open('banned_ips','a'),self.connectip
|
||||||
|
self.log("BANNED IP:",self.connectip)
|
||||||
except: pass
|
except: pass
|
||||||
return Milter.REJECT
|
return Milter.REJECT
|
||||||
|
|
||||||
@@ -916,7 +920,7 @@ class bmsMilter(Milter.Milter):
|
|||||||
or domain in blacklist:
|
or domain in blacklist:
|
||||||
# FIXME: don't use cbv_cache for blacklist if policy is 'OK'
|
# FIXME: don't use cbv_cache for blacklist if policy is 'OK'
|
||||||
if not self.internal_connection:
|
if not self.internal_connection:
|
||||||
self.offense()
|
self.offense(inc=2)
|
||||||
if not dspam_userdir:
|
if not dspam_userdir:
|
||||||
if domain in blacklist:
|
if domain in blacklist:
|
||||||
self.log('REJECT: BLACKLIST',self.canon_from)
|
self.log('REJECT: BLACKLIST',self.canon_from)
|
||||||
|
|||||||
Reference in New Issue
Block a user