]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] arc: emit ARC headers in a deterministic order 6052/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 21 May 2026 15:56:18 +0000 (16:56 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 21 May 2026 15:56:18 +0000 (16:56 +0100)
commit152c773e8f0ad48dc8fa1d5154ce8dc1990ac0f6
treeb6bde04f2833f4b24c5b4fcb5848838161615a16
parentca9c0175c8f8c0a02e55d0221c5c196f2265dbb9
[Fix] arc: emit ARC headers in a deterministic order

lua_mime.modify_headers accepted an `order` list but it had no effect:
the headers passed through a string-keyed Lua table and were serialised
to the milter reply in arbitrary hash order. arc.lua relied on `order`
to lay out an ARC set, so the three ARC headers were emitted in a
non-deterministic order. Some validators (e.g. O365) reject ARC sets
that are not in the conventional ARC-Seal, ARC-Message-Signature,
ARC-Authentication-Results layout.

When `order` is given, emit one milter reply per header in that order
(set_milter_reply merges replies cumulatively, so a single-key reply
has no ambiguous iteration order) and apply the internal modify_header
calls in the same order.

Issue: #6045
lualib/lua_mime.lua
src/plugins/lua/arc.lua
test/functional/cases/320_arc_signing/005_header_order.robot [new file with mode: 0644]