]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Use `rule.score` when using dynamic symbols
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 10 Dec 2024 12:50:53 +0000 (12:50 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 10 Dec 2024 12:50:53 +0000 (12:50 +0000)
Issue: #5247

src/plugins/lua/multimap.lua

index c67b3ddbe97dacaf29750bf0907e696585029059..e852ce15e0f372beb39d7a7f2e8a35c9b3a7d171 100644 (file)
@@ -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,
         })