Browse Source

[Minor] Fix DNS lookup errors

tags/1.4.0
Andrew Lewis 7 years ago
parent
commit
a9dd24b172
3 changed files with 7 additions and 7 deletions
  1. 3
    3
      src/plugins/lua/multimap.lua
  2. 2
    2
      src/plugins/lua/once_received.lua
  3. 2
    2
      src/plugins/lua/rbl.lua

+ 3
- 3
src/plugins/lua/multimap.lua View File

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'])

+ 2
- 2
src/plugins/lua/once_received.lua View File

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()



+ 2
- 2
src/plugins/lua/rbl.lua View File

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



Loading…
Cancel
Save