aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-11-15 09:00:42 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-11-15 09:00:42 +0000
commit73adbf798117f119ae21957951528cba4a684418 (patch)
tree7ee4fa69ca1819f61c7832d28f60ccec982c73e2
parenta2ce135c9f3322a127fe7f4ec1198978fe9a76af (diff)
downloadrspamd-73adbf798117f119ae21957951528cba4a684418.tar.gz
rspamd-73adbf798117f119ae21957951528cba4a684418.zip
[Fix] Milter headers: fold before encoding
-rw-r--r--src/plugins/lua/milter_headers.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua
index 58a227fec..2daeeed78 100644
--- a/src/plugins/lua/milter_headers.lua
+++ b/src/plugins/lua/milter_headers.lua
@@ -213,16 +213,17 @@ local function milter_headers(task)
if not add[hname] then
add[hname] = {}
end
+ local folded = lua_util.fold_header(task, hname, value, stop_chars)
if rspamd_config:is_mime_utf8() then
- if not rspamd_util.is_valid_utf8(value) then
- value = rspamd_util.mime_header_encode(value)
+ if not rspamd_util.is_valid_utf8(folded) then
+ folded = rspamd_util.mime_header_encode(folded)
end
else
- value = rspamd_util.mime_header_encode(value)
+ folded = rspamd_util.mime_header_encode(folded)
end
table.insert(add[hname], {
order = (order or settings.default_headers_order or -1),
- value = lua_util.fold_header(task, hname, value, stop_chars)
+ value = folded
})
end