commit 122970b: [FIX]: ASN: register symbol & minor change suggested by vstakhov

Jan-Philipp Benecke jan-philipp at bnck.me
Sun Jul 11 20:49:05 UTC 2021


Author: Jan-Philipp Benecke
Date: 2021-07-11 21:06:21 +0200
URL: https://github.com/rspamd/rspamd/commit/122970bed19d568b241710f8307b2f01bb94bf5b (refs/pull/3817/head)

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


More information about the Commits mailing list