commit ce27fc0: [Minor] Store obfuscated subjects in Redis

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Sep 9 15:42:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-09-09 16:39:48 +0100
URL: https://github.com/rspamd/rspamd/commit/ce27fc077994facdd43c38516ad91227692627d2 (HEAD -> master)

[Minor] Store obfuscated subjects in Redis
Issue: #3886

---
 src/plugins/lua/history_redis.lua | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua
index b05df4e5d..c14b8d32a 100644
--- a/src/plugins/lua/history_redis.lua
+++ b/src/plugins/lua/history_redis.lua
@@ -91,7 +91,8 @@ local function normalise_results(tbl, task)
   local seconds = task:get_timeval()['tv_sec']
   tbl.unix_time = seconds
 
-  tbl.subject = task:get_header('subject') or 'unknown'
+  local subject = task:get_header('subject') or 'unknown'
+  tbl.subject = lua_util.maybe_obfuscate_string(subject, settings, 'subject')
   tbl.size = task:get_size()
   local ip = task:get_from_ip()
   if ip and ip:is_valid() then
@@ -219,9 +220,6 @@ local function handle_history_request(task, conn, from, to, reset)
             (rspamd_util:get_ticks() - t1) * 1000.0)
         collectgarbage()
         t1 = rspamd_util:get_ticks()
-        fun.each(function(e)
-          e.subject = lua_util.maybe_obfuscate_string(e.subject, settings, 'subject')
-        end, data)
         reply.rows = data
         conn:send_ucl(reply)
         lua_util.debugm(N, task, 'process + sending took %s ms',


More information about the Commits mailing list