aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/multimap.lua3
-rw-r--r--src/plugins/lua/spamassassin.lua20
2 files changed, 16 insertions, 7 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index f82a4fb38..1ef2dbe12 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -1260,7 +1260,8 @@ if opts and type(opts) == 'table' then
rspamd_config:register_symbol({
type = 'virtual',
name = s,
- parent = id
+ parent = id,
+ score = 0, -- Default score
})
rule['symbols_set'][s] = 1
end, rule['symbols'])
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index 4ebe588b4..f69c5aa66 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -1532,6 +1532,7 @@ local function post_process()
if not expression then
rspamd_logger.errx(rspamd_config, 'Cannot parse expression ' .. r['meta'])
else
+
if r['score'] then
rspamd_config:set_metric_symbol{
name = k, score = r['score'],
@@ -1540,14 +1541,21 @@ local function post_process()
one_shot = true
}
scores_added[k] = 1
+ rspamd_config:register_symbol{
+ name = k,
+ weight = calculate_score(k, r),
+ callback = meta_cb
+ }
+ else
+ -- Add 0 score to avoid issues
+ rspamd_config:register_symbol{
+ name = k,
+ weight = calculate_score(k, r),
+ callback = meta_cb,
+ score = 0,
+ }
end
- rspamd_config:register_symbol{
- name = k,
- weight = calculate_score(k, r),
- callback = meta_cb
- }
-
r['expression'] = expression
if not atoms[k] then