From: Andrew Lewis Date: Tue, 15 Nov 2016 08:35:08 +0000 (+0200) Subject: [Minor] Fix DNS lookup errors X-Git-Tag: 1.4.0~57^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1131%2Fhead;p=rspamd.git [Minor] Fix DNS lookup errors --- diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 6d33cace8..9783e99cb 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -527,9 +527,9 @@ local function multimap_callback(task, rule) if rt == 'ip' then match_rule(rule, ip) 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 if results then task:insert_result(rule['symbol'], 1, rule['map']) diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua index 5cce56f62..8c7ed0777 100644 --- a/src/plugins/lua/once_received.lua +++ b/src/plugins/lua/once_received.lua @@ -31,8 +31,8 @@ local function check_quantity_received (task) local recvh = task:get_received_headers() 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 task:inc_dns_req() diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 3308d0e5c..b1d35afc4 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -62,8 +62,8 @@ end local function rbl_cb (task) local function gen_rbl_callback(rule) 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 if not results then return end