Skip to content

fix: recover from unencoded ':' in display-name (lenient mode)#15

Open
Fneufneu wants to merge 1 commit intohorde:FRAMEWORK_6_0from
Fneufneu:fix/unencoded-colon-in-display-name
Open

fix: recover from unencoded ':' in display-name (lenient mode)#15
Fneufneu wants to merge 1 commit intohorde:FRAMEWORK_6_0from
Fneufneu:fix/unencoded-colon-in-display-name

Conversation

@Fneufneu
Copy link
Copy Markdown

Note: Claude proposed a much cleaner fix and tests than I would have. Feel free to close this PR if that's a problem or if you prefer a different approach.

RFC 5322 disallows ':' in an unquoted phrase, but mailers such as AlumnForce/Swift produce name-addr headers like

"ACME : The professional network addr@host"

In lenient/non-strict mode, the parser raised an internal "Error when parsing group" and silently dropped the address. It now recovers when a '<' is present before the next ',' or ';' and returns the mailbox with the full original text as the personal part. Strict mode still rejects such input.

Co-Authored-By: Claude Opus 4.7

RFC 5322 disallows ':' in an unquoted phrase, but mailers such as
AlumnForce/Swift produce name-addr headers like

  "ACME : The professional network <addr@host>"

In lenient/non-strict mode, the parser raised an internal
"Error when parsing group" and silently dropped the address. It now
recovers when a '<' is present before the next ',' or ';' and returns
the mailbox with the full original text as the personal part. Strict
mode still rejects such input.

Co-Authored-By: Claude Opus 4.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant