]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Store module that has set the pre-result
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 2 Jan 2023 21:48:13 +0000 (21:48 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 2 Jan 2023 21:48:13 +0000 (21:48 +0000)
src/libserver/protocol.c
src/plugins/lua/history_redis.lua

index 9d83ae1db7cdeded3aa4d739b46d30130cd00a00..380d801349020d1161701c43261bebd449f55113 100644 (file)
@@ -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,
index 01645a41049b152f4f173f25f53ed6968e73857d..c203d354b0b6b75ad5be985e3c474c2929617ec6 100644 (file)
@@ -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)