summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-13 11:09:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-13 11:09:13 +0000
commitb7668ec7b3401bd921e643b4b43d261ae6d887e6 (patch)
tree1c81a0032afb8bdadc2546abe87197de67311ecc
parent86ad59f4c5f639649c1b490b60c0896486631de6 (diff)
downloadrspamd-b7668ec7b3401bd921e643b4b43d261ae6d887e6.tar.gz
rspamd-b7668ec7b3401bd921e643b4b43d261ae6d887e6.zip
[Minor] Fix rbls rules count calculation
-rw-r--r--src/plugins/lua/rbl.lua6
1 files 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