aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-20 00:17:15 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-20 00:17:15 +0000
commitcb062bf2f46a5906bc1f9a0c65f1978d97e7b35c (patch)
tree233f1746f5087365dad0d3bf3db2520cc2b55488 /src
parent103fa725c43af5add81dca75232b9cde4cc450a5 (diff)
downloadrspamd-cb062bf2f46a5906bc1f9a0c65f1978d97e7b35c.tar.gz
rspamd-cb062bf2f46a5906bc1f9a0c65f1978d97e7b35c.zip
Check type of rule in multimap module.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/multimap.lua16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index a7008b82f..33ad35a2c 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -282,13 +282,17 @@ end
local opts = rspamd_config:get_all_opt('multimap')
if opts and type(opts) == 'table' then
for k,m in pairs(opts) do
- local rule = add_multimap_rule(k, m)
- if not rule then
- rspamd_logger.err('cannot add rule: "'..k..'"')
- else
- if type(rspamd_config.get_api_version) ~= 'nil' then
- rspamd_config:register_virtual_symbol(m['symbol'], 1.0)
+ if type(m) == 'table' then
+ local rule = add_multimap_rule(k, m)
+ if not rule then
+ rspamd_logger.err('cannot add rule: "'..k..'"')
+ else
+ if type(rspamd_config.get_api_version) ~= 'nil' then
+ rspamd_config:register_virtual_symbol(m['symbol'], 1.0)
+ end
end
+ else
+ rspamd_logger.err('parameter ' .. k .. ' is invalid, must be an object')
end
end
-- add fake symbol to check all maps inside a single callback