]> source.dussan.org Git - rspamd.git/commitdiff
We need take 2nd hop
authorDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>
Mon, 14 Oct 2024 17:42:00 +0000 (19:42 +0200)
committerDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>
Mon, 14 Oct 2024 17:42:00 +0000 (19:42 +0200)
src/plugins/lua/elastic.lua

index c5e24d773d74e1e06098227af587b596e687530c..f35de152be2a5370c47713167dd7b88d87194d88 100644 (file)
@@ -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