aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>2024-10-14 19:42:00 +0200
committerDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>2024-10-14 19:42:00 +0200
commita36862365709e1bad71b1612d01ea5e3b47cc5bc (patch)
tree3ddcba0a9b11f6df7a79073d8cb538615c70a483 /src/plugins
parent5196d84d421e3e17d7ef4d3a690bb1ba6988a838 (diff)
downloadrspamd-a36862365709e1bad71b1612d01ea5e3b47cc5bc.tar.gz
rspamd-a36862365709e1bad71b1612d01ea5e3b47cc5bc.zip
We need take 2nd hop
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/elastic.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua
index c5e24d773..f35de152b 100644
--- a/src/plugins/lua/elastic.lua
+++ b/src/plugins/lua/elastic.lua
@@ -310,8 +310,9 @@ local function get_received_delay(received_headers)
local now = math.floor(rspamd_util.get_time())
local timestamp = 0
local delay = 0
- for _, received_header in ipairs(received_headers) do
- if received_header['timestamp'] and received_header['timestamp'] > 0 then
+ for i, received_header in ipairs(received_headers) do
+ -- skip first received_header as it's own relay
+ if i > 1 and received_header['timestamp'] and received_header['timestamp'] > 0 then
timestamp = received_header['timestamp']
break
end