Skip to content

feat: RFC 5322 compliant email address parser#3

Open
malsony wants to merge 2 commits into
UnsafeLabs:mainfrom
malsony:fix/rfc5322-parser
Open

feat: RFC 5322 compliant email address parser#3
malsony wants to merge 2 commits into
UnsafeLabs:mainfrom
malsony:fix/rfc5322-parser

Conversation

@malsony
Copy link
Copy Markdown

@malsony malsony commented May 17, 2026

/claim #1

Changes

  • parser.pyRFC5322Address dataclass + AddressParser class with parse(), parse_address_list(), parse_mailbox_list()
  • Full ABNF grammar from RFC 5322 §3.2-§3.4 + obsolete §4.4
  • strict=True rejects all obs-* productions, permissive mode accepts them
  • test_parser.py — 112 test cases, all passing, organized by RFC section
  • compliance.md — maps all ABNF productions to RFC sections, parser methods, and test cases
  • Pure Python stdlib, no external dependencies
  • Type hints on all public methods
  • Max line length: 998 characters (RFC 5322 limit)

💳 Payment: My GitHub registered email address / USDT (TRC20): TWPjPKBMT6yGgngQqBNJttg6yuteyQroXT

malsony added 2 commits May 18, 2026 00:10
- AddressParser class with parse(), parse_address_list(), parse_mailbox_list()
- Full ABNF grammar from §3.2-§3.4 + obsolete §4.4
- strict=True rejects obs-*, permissive accepts them
- 111 test cases, all passing
- compliance.md mapping all ABNF productions
- Pure Python stdlib, no external deps
- Type hints on all public methods

/claim UnsafeLabs#1
…orrections

- Strict mode now rejects dots between atoms in phrases (obs-phrase)
- _parse_group() captures position before CFWS, not after
- compliance.md: corrected RFC section numbers, populated test cases
- 112 tests passing

/claim UnsafeLabs#1
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