[Rspamd] milter update Content-Type and Content-Transfer-Encoding header after need_rewrite_ct
This commit is contained in:
parent
6f4720e1ea
commit
98cdb95bc0
@ -621,10 +621,24 @@ rspamd_config:register_symbol({
|
|||||||
local nct = string.format('%s: %s/%s; charset=utf-8',
|
local nct = string.format('%s: %s/%s; charset=utf-8',
|
||||||
'Content-Type', rewrite.new_ct.type, rewrite.new_ct.subtype)
|
'Content-Type', rewrite.new_ct.type, rewrite.new_ct.subtype)
|
||||||
out[#out + 1] = nct
|
out[#out + 1] = nct
|
||||||
|
-- update Content-Type header
|
||||||
|
task:set_milter_reply({
|
||||||
|
remove_headers = {['Content-Type'] = 0},
|
||||||
|
})
|
||||||
|
task:set_milter_reply({
|
||||||
|
add_headers = {['Content-Type'] = string.format('%s/%s; charset=utf-8', rewrite.new_ct.type, rewrite.new_ct.subtype)}
|
||||||
|
})
|
||||||
return
|
return
|
||||||
elseif name:lower() == 'content-transfer-encoding' then
|
elseif name:lower() == 'content-transfer-encoding' then
|
||||||
out[#out + 1] = string.format('%s: %s',
|
out[#out + 1] = string.format('%s: %s',
|
||||||
'Content-Transfer-Encoding', 'quoted-printable')
|
'Content-Transfer-Encoding', 'quoted-printable')
|
||||||
|
-- update Content-Transfer-Encoding header
|
||||||
|
task:set_milter_reply({
|
||||||
|
remove_headers = {['Content-Transfer-Encoding'] = 0},
|
||||||
|
})
|
||||||
|
task:set_milter_reply({
|
||||||
|
add_headers = {['Content-Transfer-Encoding'] = 'quoted-printable'}
|
||||||
|
})
|
||||||
seen_cte = true
|
seen_cte = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user