chore: rename SMTP env vars to LETS_CHAT_SMTP_* (LC-201) #244

Merged
David merged 2 commits from chore/lc-201-prefix-smtp-env-vars into main 2026-05-28 10:37:56 +02:00
Owner

Summary

Brings the SMTP mailer config into the LETS_CHAT_* namespace shared by every other runtime env var, and fixes the stale state.rs mailer comment that referenced a nonexistent LETS_CHAT_SMTP_URL var.

Rename map

SMTP_HOST -> LETS_CHAT_SMTP_HOST, SMTP_PORT -> LETS_CHAT_SMTP_PORT, SMTP_TLS -> LETS_CHAT_SMTP_TLS, SMTP_FROM -> LETS_CHAT_SMTP_FROM, SMTP_USERNAME -> LETS_CHAT_SMTP_USERNAME, SMTP_PASSWORD -> LETS_CHAT_SMTP_PASSWORD.

Hard rename, no dual-read fallback. Nothing in production sets the flat names yet (no lets-chat compose-secrets.yml exists and LC-200 is still open), so a dual-read path would be dead weight.

Changes

  • server/src/mail.rs: env reads, doc block, warn! messages.
  • server/src/state.rs:47: rewrote comment to LETS_CHAT_SMTP_HOST / _PORT / _TLS / _FROM, dropped the nonexistent _URL.
  • server/src/routes/admin.rs: two SMTP_* comment references on the gutted settings handler.
  • server/migrations/settings/0006_drop_smtp_settings.sql: comment reference.
  • server/templates/admin/settings.html: admin UI hint text.
  • server/tests/email_notification_dispatch.rs, server/tests/email_notification_post_path.rs: set/remove the prefixed names.
  • README.md (env table + setup list), docs/email-ingress.md, .env.standalone: operator docs.
  • compose.dev-web.yml, compose.dev-web-saas.yml, compose.dev.yml.1: dev-stack env blocks.

Coordination

LC-200's server/c-01/lets-chat/compose-variables.yml and compose-secrets.yml must adopt the prefixed names; this rename should land before or together with the LC-200 deployment.

Verification

rg '\bSMTP_(HOST|PORT|TLS|FROM|USERNAME|PASSWORD)\b' --glob '!docs/superpowers/**' returns zero matches. ./dev/cargo check -p lets-chat-server --all-targets is clean. email_notification_dispatch (7 tests) and email_notification_post_path (3 tests) pass. Full cargo test is green except a pre-existing concurrent-load flake in email_ingress_attachments::jpeg_re_encode_strips_exif_signature_from_stored_bytes (passes in isolation on main too). just check's clippy step trips on a pre-existing too_many_arguments on resolve_msg_author in server/src/routes/mod.rs:153 that also reproduces on main and is out of scope for this rename.

LC-201

## Summary Brings the SMTP mailer config into the `LETS_CHAT_*` namespace shared by every other runtime env var, and fixes the stale `state.rs` mailer comment that referenced a nonexistent `LETS_CHAT_SMTP_URL` var. ## Rename map `SMTP_HOST` -> `LETS_CHAT_SMTP_HOST`, `SMTP_PORT` -> `LETS_CHAT_SMTP_PORT`, `SMTP_TLS` -> `LETS_CHAT_SMTP_TLS`, `SMTP_FROM` -> `LETS_CHAT_SMTP_FROM`, `SMTP_USERNAME` -> `LETS_CHAT_SMTP_USERNAME`, `SMTP_PASSWORD` -> `LETS_CHAT_SMTP_PASSWORD`. Hard rename, no dual-read fallback. Nothing in production sets the flat names yet (no lets-chat `compose-secrets.yml` exists and LC-200 is still open), so a dual-read path would be dead weight. ## Changes - `server/src/mail.rs`: env reads, doc block, `warn!` messages. - `server/src/state.rs:47`: rewrote comment to `LETS_CHAT_SMTP_HOST / _PORT / _TLS / _FROM`, dropped the nonexistent `_URL`. - `server/src/routes/admin.rs`: two `SMTP_*` comment references on the gutted settings handler. - `server/migrations/settings/0006_drop_smtp_settings.sql`: comment reference. - `server/templates/admin/settings.html`: admin UI hint text. - `server/tests/email_notification_dispatch.rs`, `server/tests/email_notification_post_path.rs`: set/remove the prefixed names. - `README.md` (env table + setup list), `docs/email-ingress.md`, `.env.standalone`: operator docs. - `compose.dev-web.yml`, `compose.dev-web-saas.yml`, `compose.dev.yml.1`: dev-stack env blocks. ## Coordination LC-200's `server/c-01/lets-chat/compose-variables.yml` and `compose-secrets.yml` must adopt the prefixed names; this rename should land before or together with the LC-200 deployment. ## Verification `rg '\bSMTP_(HOST|PORT|TLS|FROM|USERNAME|PASSWORD)\b' --glob '!docs/superpowers/**'` returns zero matches. `./dev/cargo check -p lets-chat-server --all-targets` is clean. `email_notification_dispatch` (7 tests) and `email_notification_post_path` (3 tests) pass. Full `cargo test` is green except a pre-existing concurrent-load flake in `email_ingress_attachments::jpeg_re_encode_strips_exif_signature_from_stored_bytes` (passes in isolation on `main` too). `just check`'s clippy step trips on a pre-existing `too_many_arguments` on `resolve_msg_author` in `server/src/routes/mod.rs:153` that also reproduces on `main` and is out of scope for this rename. LC-201
chore: rename SMTP env vars to LETS_CHAT_SMTP_* (LC-201)
Some checks failed
check-secrets / Nosey parker (push) Successful in 4s
check-secrets / Kingfisher (push) Successful in 6s
check-secrets / TruffleHog (push) Successful in 5s
check-secrets / TruffleHog (pull_request) Successful in 5s
check-secrets / Nosey parker (pull_request) Successful in 6s
check-secrets / Kingfisher (pull_request) Successful in 7s
Check / clippy + fmt + tests (pull_request) Failing after 14s
66801a8787
Bring the SMTP mailer config into the LETS_CHAT_* namespace shared by every other runtime env var, and fix the stale `state.rs` mailer comment that referenced a nonexistent LETS_CHAT_SMTP_URL var.

Renames: SMTP_HOST/PORT/TLS/FROM/USERNAME/PASSWORD -> LETS_CHAT_SMTP_HOST/PORT/TLS/FROM/USERNAME/PASSWORD. Hard rename, no dual-read fallback (no deployment currently sets the flat names).

Touched: server/src/mail.rs (env reads + doc block + warn! messages), server/src/state.rs (mailer doc comment), server/src/routes/admin.rs (two SMTP_* comment references), server/migrations/settings/0006_drop_smtp_settings.sql (comment), server/templates/admin/settings.html (admin UI text), server/tests/email_notification_{dispatch,post_path}.rs, README.md, .env.standalone, docs/email-ingress.md, compose.dev-web.yml, compose.dev-web-saas.yml, compose.dev.yml.1.

Verified no unprefixed SMTP_(HOST|PORT|TLS|FROM|USERNAME|PASSWORD) remains outside docs/superpowers/. `just check` clippy error pre-exists on main (too_many_arguments on resolve_msg_author) and is unrelated. Renamed tests pass; full `cargo test` is green except a flake under concurrent load (email_ingress_attachments::jpeg_re_encode_..., passes in isolation on main too).

#LC-201
Merge branch 'main' into chore/lc-201-prefix-smtp-env-vars
Some checks failed
check-secrets / TruffleHog (pull_request) Successful in 3s
check-secrets / Nosey parker (pull_request) Successful in 4s
check-secrets / Nosey parker (push) Successful in 4s
check-secrets / Kingfisher (push) Successful in 6s
check-secrets / TruffleHog (push) Successful in 6s
check-secrets / Kingfisher (pull_request) Successful in 7s
Check / clippy + fmt + tests (pull_request) Failing after 12s
Create release / Create release from merged PR (pull_request) Has been skipped
0cc10bbaad
David merged commit 675309398d into main 2026-05-28 10:37:56 +02:00
David deleted branch chore/lc-201-prefix-smtp-env-vars 2026-05-28 10:37:57 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!244
No description provided.