summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-15 21:33:27 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-15 21:33:27 +0400
commita801ef55cfff3552f2f5c54c09d85172a90c4bb8 (patch)
treeaea6892d136841928cca15823c6226fe5efbfd6c /src/plugins
parent958d7dcbadb9190f67aca0bbe2573533ad6fc63d (diff)
downloadrspamd-a801ef55cfff3552f2f5c54c09d85172a90c4bb8.tar.gz
rspamd-a801ef55cfff3552f2f5c54c09d85172a90c4bb8.zip
Fix multimap module if there is only one rule for it.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/multimap.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index 6e949b721..fa049d3b5 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -133,10 +133,17 @@ local opts = rspamd_config:get_all_opt('multimap')
if opts then
local strrules = opts['rule']
if strrules then
- for _,value in ipairs(strrules) do
- local params = split(value, ',')
+ if type(strrules) == 'array' then
+ for _,value in ipairs(strrules) do
+ local params = split(value, ',')
+ if not add_rule (params) then
+ rspamd_logger:err('cannot add rule: "'..value..'"')
+ end
+ end
+ elseif type(strrules) == 'string' then
+ local params = split(strrules, ',')
if not add_rule (params) then
- rspamd_logger:err('cannot add rule: "'..value..'"')
+ rspamd_logger:err('cannot add rule: "'..strrules..'"')
end
end
end