BUGFIX: Fix SPF parsing of qualified mechanisms like +mx#4062
Merged
tlimoncelli merged 1 commit intoStackExchange:mainfrom Feb 10, 2026
Merged
Conversation
Collaborator
Author
|
Ping @grahammiln, @tlimoncelli. |
…ge#4042) - The `lcpart` variable was created before stripping the qualifier (`+`,`-`,`~`,`?`), causing `HasPrefix` checks to fail for mechanisms like "+mx" or "+a" when used with `SPF_BUILDER's` overflow option.
4091319 to
680dae6
Compare
Contributor
|
Ah! So much better! Thank you for digging into that to figure out what was wrong. |
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.
Fixes a regression where
SPF_BUILDERwithoverflowrejected valid RFC 7208 qualified mechanisms like+mx,~mx,?a, etc. with the errorunsupported SPF part mx. The root cause was thatlcpart(the lowercase comparison variable) was created before stripping the qualifier prefix (+,-,~,?), soHasPrefixchecks against"mx"or"a"failed when the string was still"+mx"or"+a". Qualifiers on mechanisms are valid per RFC 7208 Section 4.7. A regression test covering all qualifier/mechanism combinations has been added.Fixes #4042