public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Rspamd] milter update Content-Type and Content-Transfer-Encoding header after need_rewrite_ct
98cdb95b
data/conf/rspamd/lua/rspamd.local.lua | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Diff
diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua
index 45506f3b..5f23ef6b 100644
--- a/data/conf/rspamd/lua/rspamd.local.lua
+++ b/data/conf/rspamd/lua/rspamd.local.lua
@@ -621,10 +621,24 @@ rspamd_config:register_symbol({
local nct = string.format('%s: %s/%s; charset=utf-8',
'Content-Type', rewrite.new_ct.type, rewrite.new_ct.subtype)
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
elseif name:lower() == 'content-transfer-encoding' then
out[#out + 1] = string.format('%s: %s',
'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
return
end