Commit 47a05ac1 authored by ale's avatar ale
Browse files

Make DNSBL domains configurable

parent a699ff25
......@@ -21,6 +21,7 @@ class DBLPlugin(BasePlugin):
def __init__(self, config):
data_dir = config.get('data_dir', './data')
concurrent = config.get('concurrent', False)
self._dbl_domain = config.get('dbl_domain', 'dbl.spamhaus.org')
self._cache = get_shelve(os.path.join(data_dir, 'dbl_cache'), concurrent)
def _normalize_domain(self, host):
......@@ -39,7 +40,7 @@ class DBLPlugin(BasePlugin):
results[domain] = False
if domain not in self._cache:
try:
q = '%s.dbl.spamhaus.org' % domain
q = '%s.%s' % (domain, self._dbl_domain)
res = socket.gethostbyname(q)
self._cache[domain] = True
except socket.gaierror:
......
......@@ -22,7 +22,8 @@ class SURBLPlugin(BasePlugin):
def __init__(self, config):
data_dir = config.get('data_dir', './data')
concurrent = config.get('concurrent', False)
concurrent = config.get('concurrent', False)
self._surbl_domain = config.get('surbl_domain', 'multi.surbl.org')
self._cache = get_shelve(os.path.join(data_dir, 'surbl_cache'), concurrent)
def _normalize_ips(self, host):
......@@ -40,7 +41,7 @@ class SURBLPlugin(BasePlugin):
def surbl_lookup(domain):
if domain not in self._cache:
try:
q = '%s.multi.surbl.org' % domain
q = '%s.%s' % (domain, self._surbl_domain)
res = socket.gethostbyname(q)
self._cache[domain] = True
except socket.gaierror:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment