aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-01-31 13:22:32 -0800
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-01-31 13:22:32 -0800
commit30879cec311b7b0b0a60da7b7c5554d7c9f146bb (patch)
tree1e2cc1ff4e4c3494a38f8fa3a8cf19a7d19487bd /src
parentf5babd9dfdbdcc267579439fc5f7d57c9ec670e0 (diff)
parent86086d65b2c3b53d1974c6dc83ea9ab848d42e9e (diff)
downloadrspamd-30879cec311b7b0b0a60da7b7c5554d7c9f146bb.tar.gz
rspamd-30879cec311b7b0b0a60da7b7c5554d7c9f146bb.zip
Merge pull request #34 from fatalbanana/master
Support HELO blacklist and fix options registration for RDNS blacklist
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/rbl.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 0dcc48e7b..b40278f55 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -77,6 +77,14 @@ local function rbl_cb (task)
task:inc_dns_req()
end
+ local helo = task:get_helo()
+ if helo and string.sub(helo,1,1) ~= '[' then
+ for k,rbl in pairs(rbls) do
+ if rbl['helo'] then
+ task:get_resolver():resolve_a(task:get_session(), task:get_mempool(), helo .. '.' .. rbl['rbl'], rbl_dns_cb, k)
+ end
+ end
+ end
local sender_dns = task:get_hostname()
if sender_dns ~= nil and sender_dns ~= 'unknown' then
for k,rbl in pairs(rbls) do
@@ -117,6 +125,8 @@ if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_module_option('rbl', 'default_ipv6', 'string')
rspamd_config:register_module_option('rbl', 'default_received', 'string')
rspamd_config:register_module_option('rbl', 'default_from', 'string')
+ rspamd_config:register_module_option('rbl', 'default_rdns', 'string')
+ rspamd_config:register_module_option('rbl', 'default_helo', 'string')
end
end
@@ -143,8 +153,11 @@ end
if(opts['default_rdns'] == nil) then
opts['default_rdns'] = false
end
+if(opts['default_helo'] == nil) then
+ opts['default_helo'] = false
+end
for key,rbl in pairs(opts['rbls']) do
- local o = { "ipv4", "ipv6", "from", "received", "unknown", "rdns" }
+ local o = { "ipv4", "ipv6", "from", "received", "unknown", "rdns", "helo" }
for i=1,table.maxn(o) do
if(rbl[o[i]] == nil) then
rbl[o[i]] = opts['default_' .. o[i]]