summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/spamassassin.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-09-01 17:25:12 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-09-01 17:25:12 +0200
commitf552edd887794a5086dcf93d36f8f82d83553196 (patch)
tree3e4073dbcd20744cb02caa51d8b12d6e451bcae0 /src/plugins/lua/spamassassin.lua
parent99c2eb287a15649c0dac67065b0254c2a94a768f (diff)
downloadrspamd-f552edd887794a5086dcf93d36f8f82d83553196.tar.gz
rspamd-f552edd887794a5086dcf93d36f8f82d83553196.zip
[Feature] Add common way to disable Lua modules
Diffstat (limited to 'src/plugins/lua/spamassassin.lua')
-rw-r--r--src/plugins/lua/spamassassin.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index cf17aa247..533b83864 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -114,6 +114,12 @@ local sa_lists = {
local func_cache = {}
local section = rspamd_config:get_all_opt("spamassassin")
+if not (section and type(section) == 'table') then
+ rspamd_logger.info('Module is unconfigured')
+elseif section['enabled'] == false then
+ rspamd_logger.info('Module is disabled')
+ return
+end
-- Minimum score to treat symbols as meta
local meta_score_alpha = 0.5