FA-76438 / Email MIME structure / Member archive
Resolve and de-duplicate attachment file names: name precedence · case 03
The ASCII fallback filename replaces the properly decoded extended filename.
Case contract
Each part has optional fstar (already decoded filename*), fname (filename) and ctname (Content-Type name) and a type. Precedence is fstar, fname, ctname. Directory components are removed (both "/" and "\" separate). An empty name, "." or ".." becomes "attachment" plus an extension by type (.pdf, .png, .txt, else .bin). Names are de-duplicated case-insensitively: the k-th copy gets " (k)" before the last extension, or at the end when there is no extension or the name starts with its only dot.
Why this case matters
Attachment names end up on disk; wrong names overwrite files, leak paths or confuse users.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| extended name wins | ["resume.pdf"] | ["r\u00e9sum\u00e93.pdf"] | 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 ↗