Skip to content

feat: mail safety (no live placeholder relayhost) + mailpit sink#27

Merged
kathrynalpert merged 1 commit into
NrgXnat:mainfrom
kathrynalpert:mail-safety-and-extraenv
Jun 24, 2026
Merged

feat: mail safety (no live placeholder relayhost) + mailpit sink#27
kathrynalpert merged 1 commit into
NrgXnat:mainfrom
kathrynalpert:mail-safety-and-extraenv

Conversation

@kathrynalpert

@kathrynalpert kathrynalpert commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Security fix: the shipped default RELAYHOST (smtp.myrelay.net:587) is a live host on the public internet, so an unconfigured relay would silently hand outbound mail (password resets, notifications) to a third party. This removes the default and makes RELAYHOST required when the relay is enabled.

  • a render-time validation fails with a clear message when mail.enabled is true and RELAYHOST is unset
  • builds on the existing mail.enabled switch (default false, from Adds switch for postfix dependency #18): the bundled postfix relay stays off unless explicitly enabled, so external-SMTP or sink installs render clean
  • optional mailpit SMTP sink (mailpit.enabled, default false) for dev/test: accepts everything on :1025, stores in-container with a web UI/JSON API on :8025, cannot relay onward. Point XNAT's [notifications] SMTP host at <release>-mailpit:1025. Hardened to pass restricted Pod Security Admission.

No manual Chart.yaml version bump — left to the release workflow (feat → minor).

Verified: default values (mail off) render clean; mail.enabled=true with no RELAYHOST fails render; mail.enabled=false + mailpit.enabled=true renders the sink and zero postfix resources; relay mode with a real RELAYHOST renders; helm lint clean.

@kathrynalpert kathrynalpert force-pushed the mail-safety-and-extraenv branch 3 times, most recently from 85c7cdd to d2e9d81 Compare June 15, 2026 19:03
Security fix: the default RELAYHOST placeholder smtp.myrelay.net:587
RESOLVES on the public internet (37.97.253.64 as of 2026-06-12) -- an
unconfigured install hands every outbound message (password resets,
notifications) to whoever operates that host. And with no RELAYHOST at
all, bokysan/docker-postfix falls back to direct-to-internet MX
delivery. Neither failure announces itself.

* RELAYHOST default removed; a render-time validation (validate-mail)
  fails with a clear message when mail.enabled is true and no RELAYHOST
  is set
* the validation builds on the existing mail.enabled switch (added in
  NrgXnat#18, default false): it only bites when the bundled relay is turned
  on, so external-SMTP and mailpit-sink installs render clean
* optional mailpit SMTP sink (mailpit.enabled, default false) for
  dev/test: accepts everything on :1025, stores in-container with a
  web UI/JSON API on :8025, architecturally cannot relay onward.
  Point XNAT's [notifications] SMTP host at <release>-mailpit:1025;
  hardened to pass restricted Pod Security Admission

Verified: mail.enabled=true with no RELAYHOST fails render with the
message; mail.enabled=false + mailpit.enabled=true renders the sink
and zero postfix resources; relay mode with a real RELAYHOST renders;
helm lint clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kathrynalpert kathrynalpert changed the title xnat chart: mail safety (no live placeholder relayhost) + mailpit sink feat: mail safety (no live placeholder relayhost) + mailpit sink Jun 16, 2026
@kathrynalpert kathrynalpert merged commit 7594564 into NrgXnat:main Jun 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants