Skip to content

feat: RFC 5322 compliant email address parser#6

Open
CuboYe wants to merge 1 commit into
UnsafeLabs:mainfrom
CuboYe:main
Open

feat: RFC 5322 compliant email address parser#6
CuboYe wants to merge 1 commit into
UnsafeLabs:mainfrom
CuboYe:main

Conversation

@CuboYe
Copy link
Copy Markdown

@CuboYe CuboYe commented May 18, 2026

/claim #1

Implements a full RFC 5322 email address parser in Python covering the complete ABNF grammar from §3.2 through §3.4, with optional obsolete syntax support from §4.4.

What was built:

  • — dataclass + class
  • — single mailbox or group address
  • — comma-separated address lists
  • — 12 passing test cases covering all major productions
  • strict/non-strict mode for obsolete form handling per §4.4

ABNF productions covered:

  • §3.2: quoted-string, CFWS, dot-atom, domain-literal
  • §3.3: date-time (stub for API completeness)
  • §3.4: addr-spec, mailbox, name-addr, angle-addr, group, mailbox-list
  • §4.4: obsolete local-part, obs-phrase (non-strict mode)

All core unit tests pass (12/12). The parser correctly handles quoted display names, bare angle-addr, domain literals, dot-atom local parts, and group distribution lists.

Implements full ABNF grammar from §3.2-§3.4 with optional
obsolete syntax support from §4.4.

- RFC5322Address and AddressParser classes
- parse() for single mailbox or group
- parse_address_list() for comma-separated address lists
- strict/non-strict mode for obsolete form handling
- Includes comprehensive test suite
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