From: Vsevolod Stakhov Date: Mon, 2 Jan 2023 21:48:13 +0000 (+0000) Subject: [Minor] Store module that has set the pre-result X-Git-Tag: 3.5~113 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=955fb068cd72005c7277c5f0f3c2347144dbc6ea;p=rspamd.git [Minor] Store module that has set the pre-result --- 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)