MAIL_TRANSPORT=smtp (or { transport: "smtp" }) hands mail to the app's SMTP
server via nodemailer, an optional peer loaded only then. Resend stays the
default and SMTP is never inferred from which variables exist. Same call, same
never-throwing result; tests drive a real SMTP conversation on a local socket.
Extracted from OrangeCat's email layout and made brandable: the brand colour
and the product's name were written into it, it was English only, it had no
dark mode and it took raw HTML for the heading and body.
- renderMail(brand, content) -> { html, text }: content is plain text and
escaped (only **bold**), dark mode, Outlook button, plain-text twin,
preheader, 8 block kinds. Links must be http(s)/mailto.
- The footer is a required key: reason always, unsubscribe {label,url} or
null (null only for mail asked for this minute).
- signUnsubscribe / verifyUnsubscribe (HMAC, no expiry) and
listUnsubscribeHeaders (RFC 8058 one-click).
- sendMail takes headers.
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12
Co-authored-by: Claude <noreply@anthropic.com>
- address: every app's address is hello@<its own host> (appAddress,
appAddressFromEnv), and sendMail sets it as Reply-To on every message,
so answers reach the app while mail still leaves the shared sender.
- inbound: the contract between the fleet mail gateway and an app.
InboundMail, HMAC-signed with a timestamp (signInbound/verifyInbound);
inboundHandler() refuses unsigned, tampered, stale or oversized
deliveries and answers 500 when storing fails so the gateway retries.
- triage: triageMail(mail, complete, context) asks any model for kind,
urgency, summary, language and needsHuman; never throws, falls back to
rules marked by: "rules", and treats instructions in a mail as content.
Still zero runtime dependencies.
Claude-Session: https://claude.ai/code/session_01TTH5cy8bKmEqzdTyAsbbT8
Co-authored-by: Claude <noreply@anthropic.com>
npmjs.com now trusts this repo+workflow (trusted publisher configured
2026-09-05): the NPM_TOKEN skip-dance is gone, a version tag publishes
unconditionally via the OIDC exchange npm >= 11.5 performs itself, and
npm (not pnpm) runs the publish step because the npm CLI implements
that exchange natively. v0.1.1 carries no code change — it exists to
prove the tokenless path end to end.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Born from the 2026-09-05 email sweep: ~12 bespoke implementations across
three provider styles, and a dead Brevo SMTP credential that silenced
evig+kivvi outbound mail for months unnoticed. One provider (Resend over
raw fetch, zero deps), one env contract (RESEND_API_KEY + RESEND_FROM),
one call shape: sendMail() that never throws and returns honest
{sent}|{error,status,retryable}; isMailConfigured() treating placeholder
keys and production sandbox senders as UNCONFIGURED; mailHealth() for
health endpoints; the <app>@fleetcrown.orangecat.ch sender convention
encoded once. 15 tests, golden pnpm CI, tag-driven publish, fleet
auto-merge.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn