aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-20 20:45:37 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-20 20:45:37 +0100
commit766bc1798d93051c55555511ad5b2bfc97ed2f40 (patch)
tree6a9c34fdc9b529d2c1f40d2cbb59bea01d4d8a30
parentfddf1b38c30380cbd34b4b2ca111a37cac9a1580 (diff)
parentd875d0c603a91a1f78d4b60af52c6098fa642385 (diff)
downloadrspamd-766bc1798d93051c55555511ad5b2bfc97ed2f40.tar.gz
rspamd-766bc1798d93051c55555511ad5b2bfc97ed2f40.zip
Merge pull request #373 from AlexeySa/patch-6
Fix Hfilter plugin with the new DNS API
-rw-r--r--src/plugins/lua/hfilter.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/lua/hfilter.lua b/src/plugins/lua/hfilter.lua
index 1cc2be60e..38ed0c1e5 100644
--- a/src/plugins/lua/hfilter.lua
+++ b/src/plugins/lua/hfilter.lua
@@ -175,7 +175,11 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host)
else
for _,mx in pairs(results) do
if mx['name'] then
- task:get_resolver():resolve_a(task:get_session(), task:get_mempool(), mx['name'], check_host_cb_mx_a)
+ task:get_resolver():resolve_a({
+ task=task,
+ name = mx['name'],
+ callback = check_host_cb_mx_a
+ })
end
end
end
@@ -184,7 +188,11 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host)
task:inc_dns_req()
if not results then
- task:get_resolver():resolve_mx(task:get_session(), task:get_mempool(), host, check_host_cb_mx)
+ task:get_resolver():resolve_mx({
+ task=task,
+ name = host,
+ callback = check_host_cb_mx
+ })
elseif eq_ip ~= '' then
for _,result in pairs(results) do
if result:to_string() == eq_ip then
@@ -208,7 +216,11 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host)
if check_fqdn(host) then
if eq_host == '' or eq_host ~= 'unknown' or eq_host ~= host then
- task:get_resolver():resolve_a(task:get_session(), task:get_mempool(), host, check_host_cb_a)
+ task:get_resolver():resolve_a({
+ task=task,
+ name = host,
+ callback = check_host_cb_a
+ })
end
else
task:insert_result('HFILTER_' .. symbol_suffix .. '_NOT_FQDN', 1.0)