From: Vsevolod Stakhov Date: Fri, 15 Oct 2010 17:33:27 +0000 (+0400) Subject: Fix multimap module if there is only one rule for it. X-Git-Tag: 0.3.3~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a801ef55cfff3552f2f5c54c09d85172a90c4bb8;p=rspamd.git Fix multimap module if there is only one rule for it. --- 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