Skip to content

feat: implement parse_mailbox_list per issue #1 §3.4#15

Open
CuboYe wants to merge 2 commits into
UnsafeLabs:mainfrom
CuboYe:tez-fix-14
Open

feat: implement parse_mailbox_list per issue #1 §3.4#15
CuboYe wants to merge 2 commits into
UnsafeLabs:mainfrom
CuboYe:tez-fix-14

Conversation

@CuboYe
Copy link
Copy Markdown

@CuboYe CuboYe commented May 24, 2026

Summary

Adds the missing parse_mailbox_list() method required by issue #1 acceptance criteria, plus 3 test cases covering simple lists, group rejection, and empty input.

What was done

parser.py — added parse_mailbox_list() (lines 284–310):

  • Parses comma-separated mailbox-list per RFC 5322 §3.4 ABNF: mailbox-list = 1*mailbox *("," mailbox)
  • Unlike parse_address_list(), this rejects groups — only mailboxes (addr-spec or name-addr forms) are accepted
  • Raises ValueError when a group is encountered

test_parser.py — 3 new tests (15/15 passing):

  • test_parse_mailbox_list_simple: two mailbox addresses in a list
  • test_parse_mailbox_list_rejects_group: group in mailbox list raises ValueError
  • test_parse_mailbox_list_empty: empty string and whitespace return []

Test results

15 passed in 0.02s

Note

This is a targeted fix for the one gap identified in PR #6. The existing PR #6 has broader scope (60+ tests required). This PR focuses only on the missing parse_mailbox_list method. Happy to close either PR once one is merged — or the maintainer can cherry-pick if preferred.

Tez Cubo and others added 2 commits May 19, 2026 07:28
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
- parse_mailbox_list() rejects groups (per §3.4 mailbox-list ABNF)
- 15/15 tests passing
- Addresses gap identified in PR UnsafeLabs#6 review
@CuboYe
Copy link
Copy Markdown
Author

CuboYe commented May 24, 2026

Context

This PR adds the single missing method identified in PR #6 review: parse_mailbox_list() which is required by the issue #1 acceptance criteria (§3.4 mailbox-list ABNF: 1*mailbox *("," mailbox)).

See #6 for the broader implementation.

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