From 122970bed19d568b241710f8307b2f01bb94bf5b Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Sun, 11 Jul 2021 21:06:21 +0200 Subject: [PATCH] [FIX]: ASN: register symbol & minor change suggested by vstakhov --- src/plugins/lua/asn.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/asn.lua b/src/plugins/lua/asn.lua index 2b1c28956..d62bb56c1 100644 --- a/src/plugins/lua/asn.lua +++ b/src/plugins/lua/asn.lua @@ -74,7 +74,7 @@ local function asn_check(task) task:insert_result(options['symbol'] .. '_FAIL', 1, string.format('%s:%s', req_name, dns_err)) return end - if not (results and results[1]) then + if not (results or results[1]) then rspamd_logger.infox(task, 'cannot query ip %s on %s: no results', req_name, serv) return @@ -147,6 +147,13 @@ if configure_asn_module() then flags = 'empty', score = 0, }) + rspamd_config:register_symbol{ + name = options['symbol'] .. '_FAIL', + parent = id, + type = 'virtual', + flags = 'nostat', + score = 0, + } end else lua_util.disable_module(N, 'config') -- 2.39.5