FA-76533 / Email MIME structure / Member archive
Build a bounded MIME tree summary from parser events: depth limit · case 03
One more nesting level than configured is accepted.
Case contract
events are ["open", type] (multipart start), ["leaf", type, size] and ["close"]. The root multipart has depth 1. An open that would exceed max_depth records "too-deep" and its whole subtree (including nested opens) is skipped, but it still counts as a child of its parent. A multipart closing with no children records "empty-multipart", a close with nothing open records "stray-close", and containers left open record "unclosed". Result {leaves, depth (maximum reached), errors}.
Why this case matters
Bounding MIME nesting protects mail parsers from resource exhaustion while keeping the reachable structure intact.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| three levels with limit two | {"depth": 3, "errors": [], "leaves": 4} | {"depth": 2, "errors": ["too-deep"], "leaves": 3} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗