]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] DCC: Unfold DCC header
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 26 Jun 2019 11:18:27 +0000 (12:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 26 Jun 2019 11:18:27 +0000 (12:18 +0100)
lualib/lua_scanners/dcc.lua

index d1bec769b757b565be6016e7dd995ac395bbd493..9043391d2a2f992c80a0290a5458e5621448f7f9 100644 (file)
@@ -126,11 +126,13 @@ local function dcc_check(task, content, digest, rule)
       else
         -- Parse the response
         if upstream then upstream:ok() end
-        local _,_,result,disposition,header = tostring(data):find("(.-)\n(.-)\n(.-)\n")
+        local _,_,result,disposition,header = tostring(data):find("(.-)\n(.-)\n(.-)$")
         lua_util.debugm(rule.name, task, 'DCC result=%1 disposition=%2 header="%3"',
             result, disposition, header)
 
         if header then
+          -- Unfold header
+          header = header:gsub('\r?\n%s*', ' ')
           local _,_,info = header:find("; (.-)$")
           if (result == 'R') then
             -- Reject