aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-25 13:02:40 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-25 13:02:40 +0000
commit58ed3fae4fe7c3c972e801698a0e8f1c615213ce (patch)
treede35216855f4c12f7bf728aeb6f59320a761aa83 /src/plugins
parentb87995255fa2ef0de97d509b8cd27860f014e90f (diff)
downloadrspamd-58ed3fae4fe7c3c972e801698a0e8f1c615213ce.tar.gz
rspamd-58ed3fae4fe7c3c972e801698a0e8f1c615213ce.zip
[Fix] Fix allowed_settings for neural
Issue: #3270
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/neural.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua
index 12dadd8d6..da569e698 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -1293,7 +1293,11 @@ local function process_rules_settings()
-- We set table rule.settings[id] -> { name = name, symbols = symbols, digest = digest }
for s,_ in pairs(rule.allowed_settings) do
-- Here, we have a name, set of symbols and
- local selt = lua_settings.settings_by_id(s)
+ local settings_id = s
+ if type(settings_id) ~= 'number' then
+ settings_id = lua_settings.numeric_settings_id(s)
+ end
+ local selt = lua_settings.settings_by_id(settings_id)
local nelt = {
symbols = selt.symbols, -- Already sorted
@@ -1308,16 +1312,16 @@ local function process_rules_settings()
lua_util.debugm(N, rspamd_config,
'added reference from settings id %s to %s; same symbols',
nelt.name, ex.name)
- rule.settings[s] = id
+ rule.settings[settings_id] = id
nelt = nil
end
end
end
if nelt then
- rule.settings[s] = nelt
- lua_util.debugm(N, rspamd_config, 'added new settings id %s to %s',
- nelt.name, rule.prefix)
+ rule.settings[settings_id] = nelt
+ lua_util.debugm(N, rspamd_config, 'added new settings id %s(%s) to %s',
+ nelt.name, settings_id, rule.prefix)
end
end
end