From b7668ec7b3401bd921e643b4b43d261ae6d887e6 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Mar 2018 11:09:13 +0000 Subject: [PATCH] [Minor] Fix rbls rules count calculation --- src/plugins/lua/rbl.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index e4e4c1ae8..c3c4e7136 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -531,6 +531,7 @@ local id = rspamd_config:register_symbol({ }) local is_monitored = {} +local rbls_count = 0 for key,rbl in pairs(opts['rbls']) do (function() if type(rbl) ~= 'table' or rbl['disabled'] then @@ -588,12 +589,13 @@ for key,rbl in pairs(opts['rbls']) do (not rbl['returncodes'])) then rbl['symbol'] = key end - if type(rspamd_config.get_api_version) ~= 'nil' and rbl['symbol'] then + if rbl['symbol'] then rspamd_config:register_symbol({ name = rbl['symbol'], parent = id, type = 'virtual' }) + rbls_count = rbls_count + 1 if rbl['dkim'] then need_dkim = true @@ -638,7 +640,7 @@ for key,rbl in pairs(opts['rbls']) do end)() end -if #opts.rbls == 0 then +if rbls_count == 0 then lua_util.disable_module(N, "config") end -- 2.39.5