commit a58c93a: [Minor] DCC: Unfold DCC header

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jun 26 11:21:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-26 12:18:27 +0100
URL: https://github.com/rspamd/rspamd/commit/a58c93ae7fe87956bb255c8561f591aa1a761203 (HEAD -> master)

[Minor] DCC: Unfold DCC header

---
 lualib/lua_scanners/dcc.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lualib/lua_scanners/dcc.lua b/lualib/lua_scanners/dcc.lua
index d1bec769b..9043391d2 100644
--- a/lualib/lua_scanners/dcc.lua
+++ b/lualib/lua_scanners/dcc.lua
@@ -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


More information about the Commits mailing list