Skip to content

feat(parser): implement RFC 5322 address parser#4

Open
dannyward630 wants to merge 1 commit into
UnsafeLabs:mainfrom
dannyward630:codex/rfc5322-address-parser
Open

feat(parser): implement RFC 5322 address parser#4
dannyward630 wants to merge 1 commit into
UnsafeLabs:mainfrom
dannyward630:codex/rfc5322-address-parser

Conversation

@dannyward630
Copy link
Copy Markdown

Summary

  • Add parser.py with a typed RFC5322Address model and AddressParser for mailbox, group, address-list, and mailbox-list parsing.
  • Support strict RFC 5322 forms plus permissive obsolete syntax for obs-route, obs-local-part, obs-domain, null list members, and comma-only group lists.
  • Add 76 discovered unittest cases covering quoted-pair, FWS, CFWS/comments, quoted-string, phrase/display-name, groups, domain literals, obsolete addressing, edge cases, and invalid inputs.
  • Add compliance.md mapping address-related ABNF productions to implementation and tests.
  • Annotate source.md parser-relevant sections and populate CAP blocks required by the repo workflow.

/claim #1

Payment note: I am not adding wallet/payment details because CONTRIBUTING.md describes this repository as symbolic/research and not a normal paid bounty path.

Verification

  • python3 -m unittest -v test_parser.py
  • python3 -m compileall parser.py test_parser.py
  • git diff --check
  • Manual CAP validation check: CAP block count and required fields meet .github/workflows/cap-validate.yml field/length checks.

Limitations

  • This is a practical recursive parser for RFC 5322 address syntax and the issue examples, not a formal parser generator for every possible RFC message header production outside address parsing.
  • Strict mode intentionally constrains domain literals to IPv4 and IPv6 forms; permissive mode allows obsolete escaped domain-literal text.

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