Merge pull request #5546 from mailcow/fix/domain-wide-footer

Fix: Domain Wide Disclaimer breaks attachments visualization on Gmail and Outlook #5529
This commit is contained in:
Niklas Meyer 2023-11-21 10:01:38 +01:00 committed by GitHub
commit 3b3c2b7141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -631,15 +631,19 @@ rspamd_config:register_symbol({
end
local out_parts = {}
for _,o in ipairs(out) do
if type(o) ~= 'table' then
out_parts[#out_parts + 1] = o
out_parts[#out_parts + 1] = newline_s
else
out_parts[#out_parts + 1] = o[1]
if o[2] then
out_parts[#out_parts + 1] = newline_s
end
end
if type(o) ~= 'table' then
out_parts[#out_parts + 1] = o
out_parts[#out_parts + 1] = newline_s
else
local removePrefix = "--\x0D\x0AContent-Type"
if string.lower(string.sub(tostring(o[1]), 1, string.len(removePrefix))) == string.lower(removePrefix) then
o[1] = string.sub(tostring(o[1]), string.len("--\x0D\x0A") + 1)
end
out_parts[#out_parts + 1] = o[1]
if o[2] then
out_parts[#out_parts + 1] = newline_s
end
end
end
task:set_message(out_parts)
else