diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-01-02 21:48:13 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-01-02 21:48:13 +0000 |
commit | 955fb068cd72005c7277c5f0f3c2347144dbc6ea (patch) | |
tree | 7c94ffa3201fdb534227d16465a3eefafc8d91d6 /src | |
parent | 2270056a52964f3582f46e87c89b7564d26c833e (diff) | |
download | rspamd-955fb068cd72005c7277c5f0f3c2347144dbc6ea.tar.gz rspamd-955fb068cd72005c7277c5f0f3c2347144dbc6ea.zip |
[Minor] Store module that has set the pre-result
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/protocol.c | 16 | ||||
-rw-r--r-- | src/plugins/lua/history_redis.lua | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 9d83ae1db..380d80134 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -1211,14 +1211,20 @@ rspamd_scan_result_ucl (struct rspamd_task *task, obj = top; } - if (pr && pr->message && !(pr->flags & RSPAMD_PASSTHROUGH_NO_SMTP_MESSAGE)) { - /* Add smtp message if it does not exists: see #3269 for details */ - if (ucl_object_lookup (task->messages, "smtp_message") == NULL) { - ucl_object_insert_key (task->messages, - ucl_object_fromstring_common (pr->message, 0, UCL_STRING_RAW), + if (pr) { + if (pr->message && !(pr->flags & RSPAMD_PASSTHROUGH_NO_SMTP_MESSAGE)) { + /* Add smtp message if it does not exists: see #3269 for details */ + if (ucl_object_lookup(task->messages, "smtp_message") == NULL) { + ucl_object_insert_key(task->messages, + ucl_object_fromstring_common(pr->message, 0, UCL_STRING_RAW), "smtp_message", 0, false); + } } + + ucl_object_insert_key (obj, + ucl_object_fromstring (pr->module), + "passthrough_module", 0, false); } ucl_object_insert_key (obj, diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua index 01645a410..c203d354b 100644 --- a/src/plugins/lua/history_redis.lua +++ b/src/plugins/lua/history_redis.lua @@ -89,7 +89,7 @@ local function normalise_results(tbl, task) -- Convert stupid metric object if metric then tbl.symbols = {} - local symbols, others = fun.partition(function(k, v) + local symbols, others = fun.partition(function(_, v) return type(v) == 'table' and v.score end, metric) |