aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLeftTry <lerest.go@gmail.com>2024-09-29 12:23:55 +0600
committerLeftTry <lerest.go@gmail.com>2024-09-29 12:23:55 +0600
commit36cceb7c02e9d2020239a8b008b234fc4bd26b48 (patch)
treea735c3b60bc8e71f4ec9e8447c68c5bd72b2bd6c /src/plugins
parentc4386c6ab0d649d3b999f0cf98f6fccea9212ce5 (diff)
parent6ed56a333ca7ef1b2a5a007d67fda0759af1a280 (diff)
downloadrspamd-36cceb7c02e9d2020239a8b008b234fc4bd26b48.tar.gz
rspamd-36cceb7c02e9d2020239a8b008b234fc4bd26b48.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/milter_headers.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua
index b53a45457..58a227fec 100644
--- a/src/plugins/lua/milter_headers.lua
+++ b/src/plugins/lua/milter_headers.lua
@@ -22,7 +22,7 @@ end
-- A plugin that provides common header manipulations
local logger = require "rspamd_logger"
-local util = require "rspamd_util"
+local rspamd_util = require "rspamd_util"
local N = 'milter_headers'
local lua_util = require "lua_util"
local lua_maps = require "lua_maps"
@@ -30,7 +30,7 @@ local lua_mime = require "lua_mime"
local ts = require("tableshape").types
local E = {}
-local HOSTNAME = util.get_hostname()
+local HOSTNAME = rspamd_util.get_hostname()
local settings = {
remove_upstream_spam_flag = true;
@@ -213,6 +213,13 @@ local function milter_headers(task)
if not add[hname] then
add[hname] = {}
end
+ if rspamd_config:is_mime_utf8() then
+ if not rspamd_util.is_valid_utf8(value) then
+ value = rspamd_util.mime_header_encode(value)
+ end
+ else
+ value = rspamd_util.mime_header_encode(value)
+ end
table.insert(add[hname], {
order = (order or settings.default_headers_order or -1),
value = lua_util.fold_header(task, hname, value, stop_chars)