6 Commits
Author SHA1 Message Date
Cato 64a3762fb3 feat(smtp): send through the app's own mail server as well as Resend (0.4.0) (#27)
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.
2026-11-10 09:34:21 +01:00
CatoandClaude 6285d57ff0 feat(template): one HTML email layout, signed one-click unsubscribe (0.3.0) (#26)
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>
2026-11-10 06:47:34 +01:00
CatoandClaude 532eaf29d6 feat: one address per app, mail to apps, and AI triage (v0.2.0) (#8)
- 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>
2026-10-22 11:02:47 +02:00
CatoandClaude Fable 5.1 572f43fdeb fix: the sending domain is DNS, not the product name (#6)
The rename sweep turned FLEET_SENDER_DOMAIN into loki.orangecat.ch, but only
fleetcrown.orangecat.ch is verified in Resend; every fleet app would have
sent from an unverified domain. Restored, with a comment that says why the
old name is the correct value here.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:41:06 -07:00
CatoandClaude Fable 5.1 5327df357a chore: rename FleetCrown to Loki (#5)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
4 files changed, 6 insertions(+), 6 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:24:44 -07:00
Mao NakamotoandClaude Fable 5 076e8606ee feat: @bitbaum/mail-kit v0.1.0 — the fleet's one email layer
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
2026-09-05 11:49:50 +02:00