]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix rbls rules count calculation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Mar 2018 11:09:13 +0000 (11:09 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Mar 2018 11:09:13 +0000 (11:09 +0000)
src/plugins/lua/rbl.lua

index e4e4c1ae81da3b690fa5d828419a7b848e3ae438..c3c4e7136a3f22bb04e8b9965a9972c9a0457ab2 100644 (file)
@@ -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