Get user feedback.
This commit is contained in:
+5
-3
@@ -10,6 +10,9 @@
|
||||
# CBV results.
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.2 2007/01/05 23:33:55 customdesigned
|
||||
# Make blacklist an AddrCache
|
||||
#
|
||||
# Revision 1.1 2007/01/05 21:25:40 customdesigned
|
||||
# Move AddrCache to Milter package.
|
||||
#
|
||||
@@ -52,7 +55,7 @@ class AddrCache(object):
|
||||
def has_key(self,sender):
|
||||
"True if sender is cached and has not expired."
|
||||
try:
|
||||
lsender = sender.lower()
|
||||
lsender = sender and sender.lower()
|
||||
ts,res = self.cache[lsender]
|
||||
too_old = time.time() - self.age*24*60*60 # max age in days
|
||||
if not ts or ts > too_old:
|
||||
@@ -67,8 +70,7 @@ class AddrCache(object):
|
||||
try:
|
||||
user,host = sender.split('@',1)
|
||||
return self.has_key(host)
|
||||
except ValueError:
|
||||
pass
|
||||
except: pass
|
||||
return False
|
||||
|
||||
__contains__ = has_key
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Author: Stuart D. Gathman <stuart@bmsi.com>
|
||||
# Copyright 2005 Business Management Systems, Inc.
|
||||
# This code is under the GNU General Public License. See COPYING for details.
|
||||
|
||||
# The localpart of SMTP return addresses is often signed. The format
|
||||
# of the signing is application specific and doesn't concern us -
|
||||
# except that we wish to extract some sort of fixed string from
|
||||
# the variable signature which represents the "source" of the message.
|
||||
|
||||
def unsign(s):
|
||||
"""Attempt to unsign localpart and return original email.
|
||||
No attempt is made to verify the signature.
|
||||
>>> unsign('SRS0=8Y3CZ=3U=jsconnor.com=bills@bmsi.com')
|
||||
'bills@jsconnor.com'
|
||||
"""
|
||||
# not implemented yet
|
||||
return s
|
||||
Reference in New Issue
Block a user