Repository navigation
test(bookkeeper): pin the collector's JMAP endpoint to the mail route - #6653
Conversation
The voucher collector reads mail over JMAP with basic authentication and
refuses a session whose URLs name another host than its --mail-url.
Stalwart serves JMAP only behind the Gateway route private-mail/private-mail
(mail.${domain}, mail.platform.devantler.tech in production), outside
single sign-on, and names that host in its session. mail.devantler.tech is
the mail load balancer and carries SMTP, submission and IMAPS, never HTTPS.
The collector already reads https://mail.${domain} and its egress admits
that name on 443. Inside the cluster the connection leaves through the
Gateway's public load balancer, because the Gateway accepts only PROXY
traffic and its addresses report ipMode Proxy, and the mail server admits
the Gateway's ingress identity, so the collector needs no grant into
private-mail.
Pin the URL, the route (HTTPS listener, direct backend, no SSO hop), the
egress rule, the production host and the absence of a direct grant
together, and document the endpoint and the app password the collector's
mailbox login needs.
Refs #6160, #6158
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅
|
✅
|
Code coverage overviewLanguages: Go Go / code-coverage/go
Line coverage data for the main branch is not yet available. View coverage of the 10 most covered files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
@coderabbitai review |
Action not completed
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
I reproduced the failure after integrating the current main branch, where the mail route serves both the pinned JMAP hostname and an alias. At The draft awaits hosted CI and review on this commit. |
@codex review for the intended JMAP hostname when the rendered mail route also serves aliases |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The Bookkeeper regression suite passed with |
The Bookkeeper JMAP regression guard is on protected Public JMAP discovery redirected to a session document on the same host. The document advertised the JMAP mail capability and a same-origin API URL. This verified discovery. Authenticated collection was outside this check. |

Summary
Part of #6160 and #6158. Before the voucher collector goes live, this pins the mail endpoint it reads from and documents the credential it needs. No manifest changes and no runtime effect: the collector stays suspended and its overlays stay unselected.
A survey suspected that the collector pointed at
https://mail.devantler.tech, the mail load balancer, which has no HTTPS. That is not the case. Its HelmRelease useshttps://mail.${domain}, and Flux renders that fromvariables-clusterashttps://mail.platform.devantler.tech, the Gateway routeprivate-mail/private-mail. Rendering the pinned chart gives--mail-url=https://mail.platform.devantler.tech. An anonymousGET /jmap/sessionon that host returns a session whoseapiUrlanddownloadUrlare on the same host, so the collector's same-host check passes.scripts/tests/bookkeeper/mail_endpoint_test.go(TestCollectorReadsMailThroughTheGatewayRoute). Against the rendered production apps, it checks:https://plus the route's hostname;httpslistener and goes straight toprivate-mail:8080, with no filter that could add single sign-on;private-mailadmits the Gateway, and nothing grants the collector's namespaces direct access to it.docs/operations/bookkeeper.mdrequires an app password rather than the mailbox password, and gains a "Mail endpoint" section. That section explains the route and the in-cluster path through the Gateway's load balancer. It also notes that a change to Stalwart's hostname must keep the session on the route host, for example viaSTALWART_PUBLIC_URL.Validation
go test -count=1 ./scripts/tests/bookkeeper/: 6 passed.gofmt,go vetand golangci-lint are clean.https://mail.devantler.techfails the new test, and so does routing through oauth2-proxy.ksail workload validateandksail --config ksail.prod.yaml workload validate: exit 0, 1,056 files validated. All 10 layer builds from AGENTS.md pass.Not covered
The first dev run is the real proof of the in-cluster path out through the Gateway load balancer and back. Go-live also needs an app password from the maintainer, a synthetic dev mailbox, and a reviewed PR to select each overlay. These are listed in the doc's Activation section, and come after the mailbox cutover (#5481).
🤖 Generated with Claude Code