if rt == 'ip' then | if rt == 'ip' then | ||||
match_rule(rule, ip) | match_rule(rule, ip) | ||||
else | else | ||||
local cb = function (_, _, results, err) | |||||
if err then | |||||
rspamd_logger.errx(task, 'DNS lookup failed: %s', err) | |||||
local cb = function (_, to_resolve, results, err) | |||||
if err and (err ~= 'requested record is not found' and err ~= 'no records with this name') then | |||||
rspamd_logger.errx(task, 'error looking up %s: %s', to_resolve, err) | |||||
end | end | ||||
if results then | if results then | ||||
task:insert_result(rule['symbol'], 1, rule['map']) | task:insert_result(rule['symbol'], 1, rule['map']) |
local recvh = task:get_received_headers() | local recvh = task:get_received_headers() | ||||
local function recv_dns_cb(_, to_resolve, results, err) | local function recv_dns_cb(_, to_resolve, results, err) | ||||
if err then | |||||
rspamd_logger.errx(task, 'DNS lookup error: %s', err) | |||||
if err and (err ~= 'requested record is not found' and err ~= 'no records with this name') then | |||||
rspamd_logger.errx(task, 'error looking up %s: %s', to_resolve, err) | |||||
end | end | ||||
task:inc_dns_req() | task:inc_dns_req() | ||||
local function rbl_cb (task) | local function rbl_cb (task) | ||||
local function gen_rbl_callback(rule) | local function gen_rbl_callback(rule) | ||||
return function (_, to_resolve, results, err) | return function (_, to_resolve, results, err) | ||||
if err then | |||||
rspamd_logger.errx(task, 'DNS lookup error: %s', err) | |||||
if err and (err ~= 'requested record is not found' and err ~= 'no records with this name') then | |||||
rspamd_logger.errx(task, 'error looking up %s: %s', to_resolve, err) | |||||
end | end | ||||
if not results then return end | if not results then return end | ||||