aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-04-23 15:48:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-04-23 15:48:53 +0100
commit413d624f765a49d29d8e4ab8607121f2a1e9d049 (patch)
tree3e1276454e5bf723a5ce27d29cf5c2facce7bb93 /src/plugins
parent3b3cfea31daf6d4572d819a624a6ea7ee6cd2e92 (diff)
downloadrspamd-413d624f765a49d29d8e4ab8607121f2a1e9d049.tar.gz
rspamd-413d624f765a49d29d8e4ab8607121f2a1e9d049.zip
[Feature] Lua_util: Allow to obfuscate different fields
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/clickhouse.lua5
-rw-r--r--src/plugins/lua/history_redis.lua2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index c3be9e2d9..9559ef5cb 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -438,7 +438,8 @@ local function clickhouse_collect(task)
end
local list_id = task:get_header('List-Id') or ''
- local message_id = task:get_message_id() or ''
+ local message_id = lua_util.maybe_obfuscate_string(task:get_message_id() or '',
+ settings, 'mid')
local score = task:get_metric_score('default')[1];
local bayes = 'unknown';
@@ -589,7 +590,7 @@ local function clickhouse_collect(task)
local subject = ''
if settings.insert_subject then
- subject = lua_util.maybe_obfuscate_subject(task:get_subject() or '', settings)
+ subject = lua_util.maybe_obfuscate_string(task:get_subject() or '', settings, 'subject')
end
local scan_real,scan_virtual = task:get_scan_time()
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua
index c18ea736c..ed97cb7fe 100644
--- a/src/plugins/lua/history_redis.lua
+++ b/src/plugins/lua/history_redis.lua
@@ -207,7 +207,7 @@ local function handle_history_request(task, conn, from, to, reset)
collectgarbage()
t1 = rspamd_util:get_ticks()
fun.each(function(e)
- e.subject = lua_util.maybe_obfuscate_subject(e.subject, settings)
+ e.subject = lua_util.maybe_obfuscate_string(e.subject, settings, 'subject')
end, data)
reply.rows = data
conn:send_ucl(reply)