feat(mail): derive every sender from one sending-domain variable #283
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!283
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/113-single-mail-domain-source"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Part of gitborg/gitborg-web#113 — the infra half. The portal half is gitborg/gitborg-web#117.
The duplication being removed
The sending domain was written out four times with nothing asserting they agreed:
group_vars/all/vars.ymlforgejo_mailer_from: bitborg <no-reply@mail.gitborg.se>roles/monitoring/defaultsalert_email_from: alerts@mail.gitborg.seroles/monitoring-agent/defaultsmonitoring_probe_mail_from: alerts@mail.gitborg.seEMAIL_FROMconstantOn the
email.gitborg.se→mail.gitborg.semove, the three in this repo were updated and the portal's was not. Every portal mail was rejected by the provider while the apply reported success — a wrong-account API key then masked it further as a bare HTTP 422.The change
mail_sending_domainingroup_vars/all/vars.ymlis now the single source; all three in-repo senders derive from it. A domain move is one line here.It is also passed to the portal:
bitborg-web keeps its own hardcoded
EMAIL_FROM— deliberately, since an env-set From could send as an unverified domain — but now validates it against this list and refuses to send, loudly, on a mismatch. The cross-repo disagreement becomes detected instead of silent. That is the actual fix for #113; deduplicating within this repo is the smaller half.Verified behaviour-neutral
--check --diff --tags web,forgejo,monitoring-agentagainst production:Forgejo's
app.inishows no change, and neither does the monitoring probe script — the derived values render byte-identically to the literals they replaced. So the refactor cannot have altered a sender by accident; the only functional diff is the new environment line.ansible-lintpasses on the production profile (183 files);--syntax-checkclean.Impact on apply
A brief
bitborg-webrestart (sub-second, measured earlier today — the image layer is already local). No Forgejo or Kanidm restart.Ordering with the portal PR
Either order is safe. bitborg-web treats an unset allowlist as "infra has not told us yet" and still sends, so applying this before the portal deploys — or after — cannot break mail. Only a populated list that excludes the portal's domain refuses, which is the misconfiguration we want caught.
Note
The two monitoring role defaults keep
| default('mail.gitborg.se')so those roles still render standalone, outside these group_vars.