Repository navigation
fix(config): production refuses an unset or example FROM_EMAIL - #103
Conversation
Every Railway service runs with APP_ENV=production, which refuses an example.com (.test, ...) FROM_EMAIL at boot (#103), and platform.yaml defaults email.from to noreply@example.com. A fresh apply would deploy a crash loop. Plan and apply now fail before any Railway call, and doctor reports a failing email.from check with the fix; a TODO from_email is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cd9e282 to
eba3863
Compare
|
Rebased onto main 5d72efe. The config change is as written: both apps' Added one commit: Checked on the rebased web binary with Not merged yet, per this PR's own "Depends on": main's |
Every service runs with APP_ENV=production, and the apps refuse to boot with an unset FROM_EMAIL or one on a reserved example/test domain (#103). deploy/ defaulted email.from to noreply@example.com, so a fresh make railway-setup on defaults would deploy apps that never boot. - platform: RealSender, the apps' exact rule (example.com/.net/.org, example, test, invalid, localhost; "Name <a@b>" allowed), and SenderProblems per environment (email.from or per_environment.<env>.from_email; manual is not checked). email.from now defaults to unset. - railway-setup: plan, setup and apply refuse before touching anything, with a next step; apply on a terminal without --yes asks for the sender and writes it into platform.yaml. New --email-from / PLATFORM_EMAIL_FROM (platform.Edit now sets dotted keys). doctor fails the email.from check. - docs/deploy.md and AGENTS.md: a real sender is required. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Both apps fell back to noreply@example.com when FROM_EMAIL was unset, and accepted it in production, where no mail provider sends from it: every verification, reset and invite email would fail, visible only in the log. In production the web and admin configs now refuse an unset FROM_EMAIL and any sender on a reserved example or test domain (RFC 2606/6761), in either "a@b" or "Name <a@b>" form, so the deploy fails its boot with the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…domains Production now refuses an unset or example sender, so the smoke (which boots with only what production requires) sets one. Nothing is sent: the Resend key is a dummy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fc2d8b1 to
743c773
Compare
|
The dependency is in: #132 (ece908d) makes plan, setup and apply refuse an unset or example |
Both apps fall back to
FROM_EMAIL=noreply@example.comwhen it is unset, and production accepted that sender. No mail provider sends from it, so every verification, reset and admin invite email failed, visible only as a log line.Summary
"Reserved" means
example.com|net|org,.example,.test,.invalid,.localhostand their subdomains (RFC 2606/6761), in eithera@borName <a@b>form. Development and test keep thenoreply@example.comdefault. README ("Every service runs with…") and.env.examplesay so.Evidence
Before (
main,APP_ENV=production,RESEND_API_KEYset,FROM_EMAILunset): both boot and report healthy.After (same env; each line is web, then admin):
Config is not a test boundary (AGENTS.md), so these are reproduction runs of the built binaries, not unit tests.
Checks:
make check-fast✅.make generate lint test✅ (all coverage floors pass).Depends on: deploy plan/setup rejecting the example sender
deploy/platform.yaml(andplatform.DefaultConfig) defaultemail.from: noreply@example.com, whichrailway-setupwrites intoFROM_EMAIL. With this PR alone, a freshmake railway-setupon the defaults deploys services that refuse to boot untilemail.fromis set. That refusal is the point of the fix, but the deploy tooling should catch it first. The deploy-bugs work (branchfix/template-deploy-bugs, which ownsdeploy/andrailway-setup) is making plan/setup reject thenoreply@example.comdefault. Merge it with or before this PR. This PR does not touchdeploy/.Merge Danger
Door: two-way. It is config validation only, and a revert restores the old boot behaviour.
Blast Radius: deployments. Any production web or admin deployment with an unset or example
FROM_EMAILstops booting on its next deploy and shows the reason. Its emails were already failing.🤖 Generated with Claude Code