aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-30 16:48:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-30 16:48:04 +0100
commit92cfb7f3b92813736ff949028366f989b5e5f8b1 (patch)
treecc135a825c94f0fcb2037d115ceab6fefa4ea613
parentf8ba14329f3389d24fde83f71beb02e7e902d901 (diff)
downloadrspamd-92cfb7f3b92813736ff949028366f989b5e5f8b1.tar.gz
rspamd-92cfb7f3b92813736ff949028366f989b5e5f8b1.zip
[Feature] Use scores from maps if `symbols_set` is not defined
-rw-r--r--src/plugins/lua/multimap.lua23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index e2c5e2f59..db80a2b65 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -505,22 +505,25 @@ local function multimap_callback(task, rule)
return
end
local _,symbol,score = parse_ret(r, result)
- if symbol and r['symbols_set'] then
- if not r['symbols_set'][symbol] then
- rspamd_logger.infox(task, 'symbol %s is not registered for map %s, ' ..
- 'replace it with just %s',
- symbol, r['symbol'], r['symbol'])
- symbol = r['symbol']
+ local forced = false
+ if symbol then
+ if r['symbols_set'] then
+ if not r['symbols_set'][symbol] then
+ rspamd_logger.infox(task, 'symbol %s is not registered for map %s, ' ..
+ 'replace it with just %s',
+ symbol, r['symbol'], r['symbol'])
+ symbol = r['symbol']
+ end
+ else
+ forced = true
end
- else
- symbol = r['symbol']
end
local opt = value_types[r['type']].get_value(value)
if opt then
- task:insert_result(symbol, score, opt)
+ task:insert_result(forced, symbol, score, opt)
else
- task:insert_result(symbol, score)
+ task:insert_result(forced, symbol, score)
end
if pre_filter then