]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Feature] Store matched fuzzy hashes in Redis history 5860/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 24 Jan 2026 16:33:17 +0000 (16:33 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 25 Jan 2026 10:51:59 +0000 (10:51 +0000)
Add fuzzy_hashes array to history entries by retrieving matched
hashes from task mempool in history_redis plugin.

src/plugins/lua/history_redis.lua

index a15ec0fdc18025f7417e56ff0a0288e3aafe34f7..7eec2dc03de66eaee2123ad3755377ef47ef31e3 100644 (file)
@@ -139,6 +139,12 @@ local function normalise_results(tbl, task)
   end
 
   tbl.user = task:get_user() or 'unknown'
+
+  -- Retrieve fuzzy hashes that matched during scanning
+  local fuzzy_hashes = task:get_mempool():get_variable('fuzzy_hashes', 'fstrings')
+  if fuzzy_hashes and #fuzzy_hashes > 0 then
+    tbl.fuzzy_hashes = fuzzy_hashes
+  end
 end
 
 local function history_save(task)