[Feature] Expose milter headers in legacy RSPAMC protocol#5948
Merged
[Feature] Expose milter headers in legacy RSPAMC protocol#5948
Conversation
…/SPAMC protocol Previously, milter add/remove headers and symbol options were only available via the JSON (HTTP) protocol. Legacy RSPAMC clients like Exim had no way to access them through $spam_report. This adds three new line types to the legacy text protocol output: - X-Milter-Add: Header: value — milter headers to add (with optional [N] position bracket for insert-at-position) - X-Milter-Del: Header — milter headers to remove (with optional [N] for specific instance removal) - X-Symbol: Name(score); description [opt1, opt2] — extended symbol info with descriptions and options Existing Symbol: lines are preserved for backward compatibility.
Tests RSPAMC and SPAMC protocol output for: - X-Milter-Add: lines (add headers) - X-Milter-Del: lines (remove headers) - X-Symbol: lines (extended symbol info with options) - Backward compatibility of existing Symbol: lines Also fix rspamc()/spamc() test helpers to read full response instead of truncating at 2048 bytes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
X-Symbol:linesSymbol:lines unchangedProblem
Legacy RSPAMC clients (notably Exim via
spam = nobody:truewithvariant=rspamd) only see scores, actions, and symbol names. Milter headers (X-CTCH-, X-CM-, X-Spamd-Result, etc.) and symbol options/descriptions are invisible — they only appear in the JSON response used by HTTP clients.This blocks Exim users from accessing custom headers added by modules (e.g., Cyren/CTASD, Cloudmark) for false-positive/false-negative reporting.
New protocol lines
Milter header operations
Extended symbol info
Format:
X-Symbol: NAME(SCORE); DESCRIPTION [OPT1, OPT2, ...]Exim usage example
Test plan
variant=rspamdand verify$spam_reportcontains the new linesSymbol:lines unchanged (backward compatibility)