Skip to content

fix(hub): mail an attached file under a US-ASCII name - #114

Merged
brianjfox merged 1 commit into
mainfrom
fix/attachment-mail-name
Nov 3, 2026
Merged

brianjfox merged 1 commit into
mainfrom
fix/attachment-mail-name

Conversation

@brianjfox

Copy link
Copy Markdown
Contributor

Closes #113

What

A file attached to a message is mailed to the coordinator under a US-ASCII name, so a name with a non-ASCII character, such as a macOS screenshot's, no longer fails the send.

Why

attachMaterials runs Interchange's validateAttachments, which refuses only an empty name, a line break or a double quote. The MIME assembler then requires US-ASCII, since the name goes into a signed Content-Disposition header with no encoding, and throws a plain Error for anything else. The hub turned that into a 500 on the mail route and a 503 on the materials route, and the page said "The project could not be reached". macOS names screenshots with a narrow no-break space before "AM". Details in #113.

Changes

  • apps/hub/src/artifacts/materials.ts: mailAttachmentName turns the person's name into the mailed one: space-like characters become a space, accents are dropped by NFKD, anything else outside printable ASCII is removed, and a double quote becomes an apostrophe. An empty result is "attachment".
  • apps/hub/src/artifacts/service.ts: the mailed copy carries that name; the filed material and the note keep the person's.
  • materials.test.ts covers the screenshot name, accents, quotes, a plain name and a name with nothing ASCII in it.

The validator the hub runs on attachments lets a name through that the MIME assembler then refuses, since the name goes into a signed header with no encoding; a macOS screenshot name, with its narrow no-break space, failed the whole send with a 500. The material keeps the person's name; the mailed copy carries it made plain.
@brianjfox
brianjfox merged commit 11f6fe5 into main Nov 3, 2026
9 checks passed
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.

Attaching a file with a non-ASCII name (macOS screenshots) fails with a 500 from the mail route

1 participant