From: Vsevolod Stakhov Date: Fri, 22 Mar 2019 11:06:51 +0000 (+0000) Subject: [Minor] RBL: Add fail symbols X-Git-Tag: 1.9.1~65 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=17b6bb676433ddf1d2b69a2d6e01408ec67f2e15;p=rspamd.git [Minor] RBL: Add fail symbols Issue: #2801 --- diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 3bbf46ff3..5114ffeb9 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -159,8 +159,12 @@ end local function rbl_dns_process(task, rbl, 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) + rspamd_logger.infox(task, 'error looking up %s: %s', to_resolve, err) + task:insert_result(rbl.symbol .. '_FAIL', 1, string.format('%s:%s', + to_resolve, err)) + return end + if not results then lua_util.debugm(N, task, 'DNS RESPONSE: label=%1 results=%2 error=%3 rbl=%4', @@ -554,6 +558,14 @@ local function add_rbl(key, rbl) rspamd_config:register_dependency(rbl.symbol, 'DKIM_CHECK') end + -- Failure symbol + rspamd_config:register_symbol{ + type = 'virtual', + name = rbl.symbol .. '_FAIL', + parent = id, + score = 0.0, + } + if rbl.returncodes then for s,_ in pairs(rbl['returncodes']) do rspamd_config:register_symbol({