From: Vsevolod Stakhov Date: Tue, 10 Dec 2024 12:50:53 +0000 (+0000) Subject: [Minor] Use `rule.score` when using dynamic symbols X-Git-Tag: 3.11.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d81d558de83a9624be9dae1a719bca68cfc84764;p=thirdparty%2Frspamd.git [Minor] Use `rule.score` when using dynamic symbols Issue: #5247 --- diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index c67b3ddbe9..e852ce15e0 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -1118,6 +1118,7 @@ local function multimap_on_load_gen(rule) lua_util.debugm(N, rspamd_config, "loaded map object for rule %s", rule['symbol']) local known_symbols = {} rule.map_obj:foreach(function(key, value) + local mult = rule.score or 1.0 local r, symbol, score, _ = parse_multimap_value(rule, value) if r and symbol and not known_symbols[symbol] then @@ -1127,11 +1128,11 @@ local function multimap_on_load_gen(rule) name = symbol, parent = rule.callback_id, type = 'virtual', - score = score, + score = score * mult, } rspamd_config:set_metric_symbol({ group = N, - score = 1.0, -- In future, we will parse score from `get_value` and use it as multiplier + score = mult, -- In future, we will parse score from `get_value` and use it as multiplier description = 'Automatic symbol generated by rule: ' .. rule.symbol, name = symbol, })