diff options
author | Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> | 2024-10-21 17:22:28 +0200 |
---|---|---|
committer | Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> | 2024-10-21 17:22:28 +0200 |
commit | 275879825c151abb2b2f65fbe2011f89019dd56e (patch) | |
tree | 5a135e9707bef9c291c356e5b0aca11a4ff8b616 | |
parent | 0945152bc4f99edddc926ed554b6ab6f9ed887a8 (diff) | |
download | rspamd-275879825c151abb2b2f65fbe2011f89019dd56e.tar.gz rspamd-275879825c151abb2b2f65fbe2011f89019dd56e.zip |
strip also port from sender_ip
-rw-r--r-- | src/plugins/lua/elastic.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index 373733f11..e0e941b60 100644 --- a/src/plugins/lua/elastic.lua +++ b/src/plugins/lua/elastic.lua @@ -491,7 +491,7 @@ local function get_general_metadata(task) r.sender_ip = '::' local origin = task:get_header('X-Originating-IP') if origin then - origin = origin:gsub('%[', ''):gsub('%]', '') + origin = origin:gsub('^%[', ''):gsub('%]:[0-9]+$', ''):gsub('%]$', '') local rspamd_ip = require "rspamd_ip" local origin_ip = rspamd_ip.from_string(origin) if origin_ip and origin_ip:is_valid() then |