summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/rbl.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-12-03 13:36:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-12-03 16:55:30 +0000
commitf5e2a84b6981cc12f06c908f9af277d13e64e7e8 (patch)
treeb86cc3a6ee0803e86d825240986d2b2efa553758 /src/plugins/lua/rbl.lua
parent12d38f08dd70e39bc0848390d6ec4f1f003ec335 (diff)
downloadrspamd-f5e2a84b6981cc12f06c908f9af277d13e64e7e8.tar.gz
rspamd-f5e2a84b6981cc12f06c908f9af277d13e64e7e8.zip
[Feature] Store plugins state
Diffstat (limited to 'src/plugins/lua/rbl.lua')
-rw-r--r--src/plugins/lua/rbl.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 55f2bffea..59d1de2d5 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -33,6 +33,7 @@ local hash = require 'rspamd_cryptobox_hash'
local rspamd_logger = require 'rspamd_logger'
local rspamd_util = require 'rspamd_util'
local fun = require 'fun'
+local lua_util = require 'lua_util'
local default_monitored = '1.0.0.127'
local symbols = {
@@ -417,6 +418,7 @@ end
local opts = rspamd_config:get_all_opt(N)
if not (opts and type(opts) == 'table') then
rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
+ lua_util.disable_module(N, "config")
return
end
@@ -564,6 +566,11 @@ for key,rbl in pairs(opts['rbls']) do
end
end)()
end
+
+if #opts.rbls == 0 then
+ lua_util.disable_module(N, "config")
+end
+
for _, w in pairs(white_symbols) do
for _, b in pairs(black_symbols) do
local csymbol = 'RBL_COMPOSITE_' .. w .. '_' .. b