From: Vsevolod Stakhov Date: Sun, 7 Dec 2025 15:05:13 +0000 (+0000) Subject: [Fix] Allow default_headers_order to be configured in milter_headers X-Git-Tag: 3.14.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13aa86dd0a09ae5541975bded614184470cfb1b7;p=thirdparty%2Frspamd.git [Fix] Allow default_headers_order to be configured in milter_headers Fixes #5781: The default_headers_order setting was defined in the plugin but never read from the configuration file. Add schema validation and config loading for this option. --- diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua index e13b5a9ec8..26406a5c4b 100644 --- a/src/plugins/lua/milter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -650,6 +650,7 @@ local config_schema = T.table({ authenticated_headers = T.array(T.string()):optional():doc({ summary = "Headers for authenticated users" }), extended_headers_rcpt = lua_maps.map_schema:optional():doc({ summary = "Recipients for extended headers" }), custom = T.table({}, { open = true, extra = T.string() }):optional():doc({ summary = "Custom header definitions" }), + default_headers_order = T.number():optional():doc({ summary = "Default order for headers (1 to insert after first Received header)" }), }, { open = true }):doc({ summary = "Milter headers plugin configuration" }) @@ -738,6 +739,10 @@ if type(opts['skip_all']) == 'boolean' then settings.skip_all = opts['skip_all'] end +if type(opts['default_headers_order']) == 'number' then + settings.default_headers_order = opts['default_headers_order'] +end + for _, s in ipairs(opts['use']) do if not have_routine[s] then activate_routine(s)