aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-12-10 12:50:53 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-12-10 12:50:53 +0000
commitd81d558de83a9624be9dae1a719bca68cfc84764 (patch)
tree0d4a9fea8cb2499b4d8bf51e1274f9bc236db212 /src
parent58f213c3f76f963bd5e0d1d0b995f930d89d7818 (diff)
downloadrspamd-d81d558de83a9624be9dae1a719bca68cfc84764.tar.gz
rspamd-d81d558de83a9624be9dae1a719bca68cfc84764.zip
[Minor] Use `rule.score` when using dynamic symbols
Issue: #5247
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/multimap.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index c67b3ddbe..e852ce15e 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,
})