]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Slightly improve forwarded rule
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 12 Mar 2017 10:06:22 +0000 (10:06 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 12 Mar 2017 10:06:22 +0000 (10:06 +0000)
rules/forwarding.lua

index 002c9df7add71cf3c698dd40528e969dd7726a82..a5367173fd631278676ed9cce9b1cfc695b49c0a 100644 (file)
@@ -116,11 +116,11 @@ rspamd_config.FORWARDED = {
         local to = task:get_recipients(2)
         local matches = 0
         -- Retrieve and loop through all Received headers
-        local rcvds = task:get_header_full('Received')
+        local rcvds = task:get_received_headers()
 
         if rcvds then
           for _, rcvd in ipairs(rcvds) do
-            local _,_,addr = rcvd['decoded']:lower():find("%sfor%s<(.-)>")
+            local _,_,addr = rcvd['for']
             if addr then
               matches = matches + 1
               -- Check that it doesn't match the envrcpt