From: Vsevolod Stakhov Date: Wed, 14 Oct 2020 14:32:37 +0000 (+0100) Subject: [Fix] Multimap: Fix scoring for combined maps X-Git-Tag: 2.7~237 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f7a43d5a44ffe9e8ba5343406ef3682bf57fe86;p=thirdparty%2Frspamd.git [Fix] Multimap: Fix scoring for combined maps --- diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 1ef2dbe12b..c253c660eb 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -544,7 +544,7 @@ local function multimap_callback(task, rule) return true,nil,1.0 end elseif type(p_ret) == 'boolean' then - return p_ret,nil,0.0 + return p_ret,nil,1.0 end return false,nil,0.0 @@ -1270,12 +1270,16 @@ if opts and type(opts) == 'table' then rspamd_logger.infox(rspamd_config, 'set default score 0 for multimap rule %s', rule.symbol) rule.score = 0 end - if rule['score'] then + if rule.score then -- Register metric symbol rule.name = rule.symbol rule.description = rule.description or 'multimap symbol' rule.group = rule.group or N + -- XXX: for combined maps we use trace, so flags must include one_shot to avoid scores multiplication + if rule.combined and not rule.flags then + rule.flags = 'one_shot' + end rspamd_config:set_metric_symbol(rule) end end, fun.filter(function(r) return not r['prefilter'] end, rules))