mail: RenderMail's services.roundcube unconditionally pulls in nginx+ACME — blocks any real deploy without security.acme.acceptTerms #579

Closed
opened 2026-08-15 06:17:31 +00:00 by ben · 3 comments
Owner

Found live

While driving #319's golden-clan-lab smoke-mail session (ADR 0174 standing), deploying the real internal/clan/mail.go RenderMail() output to a lab node (clan machines update node1) failed at NixOS eval time:

Failed assertions:
- You must accept the CA's terms of service before using
the ACME module by setting `security.acme.acceptTerms`
to `true`. For Let's Encrypt's ToS see https://letsencrypt.org/repository/

renderRoundcube (internal/clan/mail.go) sets services.roundcube.hostName unconditionally. Nixpkgs' services.roundcube module wires an nginx virtualHost with enableACME by default whenever hostName is set (unless explicitly overridden) — which forces the standing security.acme.acceptTerms assertion. RenderMail never sets security.acme.acceptTerms / security.acme.defaults.email, nor does it disable the module's auto-ACME wiring in favour of the front-door's own cert (ADR 0074/0116: the front door already fronts Roundcube's host over the mesh, so this node-local nginx+ACME vhost looks unintended — Roundcube likely only needs a loopback listener here, not its own public cert).

Impact

Any real production mail deploy (once mail is selectable past P4-S2 gating) would hit this exact eval-time assertion and fail to build the node's toplevel at all — a hard, catalogue-wide block, not a soft/runtime fault. This session worked around it for the lab-only deploy by dropping services.roundcube/services.postgresql entirely (not needed for #319's sendreceive/degraded/recover acceptance) — see docs/spike-findings/smoke-mail-319.md's 2026-08-15 session-4 entry. That workaround is lab-only and does not touch RenderMail itself.

Suggested fix

Either: (a) disable the roundcube module's automatic nginx+ACME vhost (bind Roundcube to loopback/mesh only, matching Stalwart's own mesh-only posture, and let the front door terminate TLS as it already does for the webmail host), or (b) if a node-local cert is genuinely wanted, wire security.acme.acceptTerms = true + defaults.email declaratively from community config. Needs a real-deploy proof (golden-clan-lab or equivalent) before considered closed — this is exactly the class of bug that only surfaces once code meets a real NixOS eval, per #319/#320's pattern.

Out of #319's scope (mail's own send/receive smoke never exercises Roundcube) — filed separately per the ticket's "work only this ticket" rule.

Ruled by agent under ADR 0174 — veto anytime. This is a bug report with a proposed fix, not itself a ruling; no code changed here.

## Found live While driving #319's golden-clan-lab smoke-mail session (ADR 0174 standing), deploying the real `internal/clan/mail.go` `RenderMail()` output to a lab node (`clan machines update node1`) failed at NixOS eval time: ``` Failed assertions: - You must accept the CA's terms of service before using the ACME module by setting `security.acme.acceptTerms` to `true`. For Let's Encrypt's ToS see https://letsencrypt.org/repository/ ``` `renderRoundcube` (`internal/clan/mail.go`) sets `services.roundcube.hostName` unconditionally. Nixpkgs' `services.roundcube` module wires an nginx virtualHost with `enableACME` by default whenever `hostName` is set (unless explicitly overridden) — which forces the standing `security.acme.acceptTerms` assertion. `RenderMail` never sets `security.acme.acceptTerms` / `security.acme.defaults.email`, nor does it disable the module's auto-ACME wiring in favour of the front-door's own cert (ADR 0074/0116: the front door already fronts Roundcube's host over the mesh, so this node-local nginx+ACME vhost looks unintended — Roundcube likely only needs a loopback listener here, not its own public cert). ## Impact Any real production mail deploy (once mail is selectable past P4-S2 gating) would hit this exact eval-time assertion and fail to build the node's toplevel at all — a hard, catalogue-wide block, not a soft/runtime fault. This session worked around it for the *lab-only* deploy by dropping `services.roundcube`/`services.postgresql` entirely (not needed for #319's sendreceive/degraded/recover acceptance) — see `docs/spike-findings/smoke-mail-319.md`'s 2026-08-15 session-4 entry. That workaround is lab-only and does not touch `RenderMail` itself. ## Suggested fix Either: (a) disable the roundcube module's automatic nginx+ACME vhost (bind Roundcube to loopback/mesh only, matching Stalwart's own mesh-only posture, and let the front door terminate TLS as it already does for the webmail host), or (b) if a node-local cert is genuinely wanted, wire `security.acme.acceptTerms = true` + `defaults.email` declaratively from community config. Needs a real-deploy proof (golden-clan-lab or equivalent) before considered closed — this is exactly the class of bug that only surfaces once code meets a real NixOS eval, per #319/#320's pattern. Out of #319's scope (mail's own send/receive smoke never exercises Roundcube) — filed separately per the ticket's "work only this ticket" rule. Ruled by agent under ADR 0174 — veto anytime. This is a bug report with a proposed fix, not itself a ruling; no code changed here.
Author
Owner

swarm-claim host=elitebook-distributed-server-03 run=6774
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=6774 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #579 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 3503757d41 is not reachable from origin/main (not landed on main)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'docs/GOTCHAS.md' is not in the diff of the claimed commits
  • changed_files: 'internal/clan/mail.go' is not in the diff of the claimed commits
  • changed_files: 'internal/clan/mail_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 579,
  "status": "success",
  "commits": [
    "3503757d41f5f95a5a9eb5a3d1ffeee2b946f2e5"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "internal/clan/mail.go",
    "internal/clan/mail_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "renderRoundcube disables the module's auto nginx+ACME vhost so no security.acme.acceptTerms assertion is forced": "internal/clan/mail.go renderRoundcube emits services.nginx.virtualHosts.<host>.enableACME = false and .forceSSL = false; pinned by TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert (mail_test.go)",
    "the front door terminates TLS, no node-local cert (fix (a))": "mail.go comment + render: front door is the only public TLS face (ADR 0074/0116), Roundcube's node-local nginx serves plain HTTP over the mesh matching Stalwart's mesh-only posture",
    "regression covered": "go test ./internal/clan/ green (TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert added, red before fix / green after)"
  },
  "summary": "RenderMail disables the roundcube nginx vhost's auto-ACME + forceSSL so the mail node builds without security.acme.acceptTerms, with the front door remaining the only public TLS face.",
  "blockers": []
}
**close-report** for #579 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 3503757d41f5f95a5a9eb5a3d1ffeee2b946f2e5 is not reachable from origin/main (not landed on main) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'docs/GOTCHAS.md' is not in the diff of the claimed commits - changed_files: 'internal/clan/mail.go' is not in the diff of the claimed commits - changed_files: 'internal/clan/mail_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 579, "status": "success", "commits": [ "3503757d41f5f95a5a9eb5a3d1ffeee2b946f2e5" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "internal/clan/mail.go", "internal/clan/mail_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/clan/", "exit_code": 0 }, { "command": "go test ./internal/clan/", "exit_code": 0 } ], "criteria": { "renderRoundcube disables the module's auto nginx+ACME vhost so no security.acme.acceptTerms assertion is forced": "internal/clan/mail.go renderRoundcube emits services.nginx.virtualHosts.<host>.enableACME = false and .forceSSL = false; pinned by TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert (mail_test.go)", "the front door terminates TLS, no node-local cert (fix (a))": "mail.go comment + render: front door is the only public TLS face (ADR 0074/0116), Roundcube's node-local nginx serves plain HTTP over the mesh matching Stalwart's mesh-only posture", "regression covered": "go test ./internal/clan/ green (TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert added, red before fix / green after)" }, "summary": "RenderMail disables the roundcube nginx vhost's auto-ACME + forceSSL so the mail node builds without security.acme.acceptTerms, with the front door remaining the only public TLS face.", "blockers": [] } ``` </details>
Author
Owner

close-report for #579 — status success

✅ close-report gates passed — every claim verified against main; closing.

envelope
{
  "issue": 579,
  "status": "success",
  "commits": [
    "3503757d41f5f95a5a9eb5a3d1ffeee2b946f2e5"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "internal/clan/mail.go",
    "internal/clan/mail_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "renderRoundcube disables the module's auto nginx+ACME vhost so no security.acme.acceptTerms assertion is forced": "internal/clan/mail.go renderRoundcube emits services.nginx.virtualHosts.<host>.enableACME = false and .forceSSL = false; pinned by TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert (mail_test.go)",
    "the front door terminates TLS, no node-local cert (fix (a))": "mail.go comment + render: front door is the only public TLS face (ADR 0074/0116), Roundcube's node-local nginx serves plain HTTP over the mesh matching Stalwart's mesh-only posture",
    "regression covered": "go test ./internal/clan/ green (TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert added, red before fix / green after)"
  },
  "summary": "RenderMail disables the roundcube nginx vhost's auto-ACME + forceSSL so the mail node builds without security.acme.acceptTerms, with the front door remaining the only public TLS face.",
  "blockers": []
}
**close-report** for #579 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 579, "status": "success", "commits": [ "3503757d41f5f95a5a9eb5a3d1ffeee2b946f2e5" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "internal/clan/mail.go", "internal/clan/mail_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/clan/", "exit_code": 0 }, { "command": "go test ./internal/clan/", "exit_code": 0 } ], "criteria": { "renderRoundcube disables the module's auto nginx+ACME vhost so no security.acme.acceptTerms assertion is forced": "internal/clan/mail.go renderRoundcube emits services.nginx.virtualHosts.<host>.enableACME = false and .forceSSL = false; pinned by TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert (mail_test.go)", "the front door terminates TLS, no node-local cert (fix (a))": "mail.go comment + render: front door is the only public TLS face (ADR 0074/0116), Roundcube's node-local nginx serves plain HTTP over the mesh matching Stalwart's mesh-only posture", "regression covered": "go test ./internal/clan/ green (TestRenderMail_RoundcubeVhostDoesNotMintItsOwnCert added, red before fix / green after)" }, "summary": "RenderMail disables the roundcube nginx vhost's auto-ACME + forceSSL so the mail node builds without security.acme.acceptTerms, with the front door remaining the only public TLS face.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-15 06:51:29 +00:00
Sign in to join this conversation.
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
Matou/idss#579
No description provided.