]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Honor mime_utf8 option in INVALID_MSGID rule 6011/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Wed, 29 Apr 2026 07:42:53 +0000 (10:42 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Wed, 29 Apr 2026 08:00:37 +0000 (11:00 +0300)
commitabec26143d0c5b8ab466bb8180c93a221df9aa62
treee6985ff737388ccb9f15b5c12cdf852673ad8a9d
parent6a174a860602e43d6c4867db176abca6a62e82ed
[Fix] Honor mime_utf8 option in INVALID_MSGID rule

Two related issues caused INVALID_MSGID false positives on valid
EAI/SMTPUTF8 Message-IDs (RFC 6532):

* The sane_msgid regexp unconditionally rejected bytes \x80-\xff,
even when mime_utf8 was enabled. Relax the regexp in that case
while keeping structural checks intact.

* The configuration option was registered only as enable_mime_utf,
but the corresponding Lua API is rspamd_config:is_mime_utf8(),
so users naturally try enable_mime_utf8. That spelling silently
had no effect because the parser did not bind it to any field.
Register enable_mime_utf8 as an alias mapped to the same struct
field so configs using it actually take effect.

Add a functional test (configs/mid_utf8.conf, messages/mid_eai_utf8.eml,
cases/107_mid_utf8.robot) that exercises both fixes via the new
option name and verifies that structurally invalid Message-IDs are
still flagged.

Issue #6007
rules/regexp/headers.lua
src/libserver/cfg_rcl.cxx
test/functional/cases/107_mid_utf8.robot [new file with mode: 0644]
test/functional/configs/mid_utf8.conf [new file with mode: 0644]
test/functional/messages/mid_eai_utf8.eml [new file with mode: 0644]