diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-10 19:17:10 +0000 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2018-01-24 14:11:52 +0200 |
commit | ac7464b6a6eb52761043987c15a3e21bec510911 (patch) | |
tree | e2e6552d53d5caf58ce0e101c7384821b3c274ba /src | |
parent | 0ebb8d0ef9d1b901d3514a7e5ac183cb7f6f1da5 (diff) | |
download | rspamd-ac7464b6a6eb52761043987c15a3e21bec510911.tar.gz rspamd-ac7464b6a6eb52761043987c15a3e21bec510911.zip |
[Fix] Sanitize IP in history redis
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/history_redis.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua index ad65184b9..8489c26f0 100644 --- a/src/plugins/lua/history_redis.lua +++ b/src/plugins/lua/history_redis.lua @@ -73,7 +73,13 @@ local function normalise_results(tbl, task) tbl.subject = task:get_header('subject') or 'unknown' tbl.size = task:get_size() - tbl.ip = tostring(task:get_from_ip() or 'unknown') + local ip = task:get_from_ip() + if ip and ip:is_valid() then + tbl.ip = tostring(ip) + else + tbl.ip = 'unknown' + end + tbl.user = task:get_user() or 'unknown' end |