Skip to content

feat(email): Bulwark webmail at mail.platform and Stalwart's web side at stalwart.platform #6662

Backlog

Description

@devantler

Goal

The maintainer wants to read his mail from devices he does not own. That means a webmail, Bulwark, at https://mail.platform.devantler.tech/. For that, Stalwart's web side (JMAP, OAuth sign-in, /account, /admin, DAV) moves to https://stalwart.platform.devantler.tech/. The same work fixes the mail server's identity: its server name is the web gateway's name today, so its SMTP greeting, autoconfig and MTA-STS policy all name the wrong host.

Decisions (maintainer, 2026-11-25)

  1. Stalwart's web side moves to stalwart.platform.devantler.tech, which becomes the OAuth issuer.
  2. Bulwark sits behind GitHub SSO (oauth2-proxy) and signs in to the mailbox only through Stalwart's own OAuth login (PKCE public client, OAUTH_ONLY). The mail password and two-factor code are typed on Stalwart's page, never Bulwark's.
  3. Uploads are allowed for the maintainer's account only: the JMAP upload ban is narrowed, so attachments, filters and the vacation reply work in webmail.
  4. Webmail sessions: 15 minutes idle, 12 hours maximum, with "remember me" off by default.

Plan

  1. Second hostname. stalwart.${domain} goes on the Stalwart route next to mail.${domain}, with tests. CORS headers allow only Bulwark's origin, set at the route rather than with Stalwart's permissive CORS. No restart.
  2. Bulwark, dark launch. A production-only third-party app: digest-pinned ghcr.io/bulwarkmail/webmail, restricted pod security, deny-all network policy plus egress only to stalwart.${domain}:443, and readiness proven before any route exists.
    • Settings: NO_THIRD_PARTY_TRAFFIC, STALWART_FEATURES=false, STALWART_ADMIN_ACCESS=off and the session policy.
  3. One announced restart, after the history copy and before MX moves. It carries:
    • the server name mail.devantler.tech;
    • STALWART_PUBLIC_URL=https://stalwart.platform.devantler.tech (both settings must change together);
    • the narrowed upload ban;
    • implicit-TLS submission on 465;
    • POP3 no longer advertised.
  4. The swap. In one apply:
    • Stalwart's route keeps only stalwart.${domain};
    • Bulwark's route takes mail.${domain} behind oauth2-proxy, DNS-only;
    • the users of the old name move with it: the bookkeeper collector URL and network policy, test(bookkeeper): pin the collector's JMAP endpoint to the mail route #6653, scripts/diagnose-email-startup, the Homepage link and the docs.
    • Reissue the maintainer's CalDAV/CardDAV profile with the same identifier.
  5. Mail auto-setup. autoconfig.devantler.tech, optionally autodiscover., routed by path to Stalwart.
  6. After MX moves. MTA-STS (mta-sts.devantler.tech, _mta-sts and _smtp._tls), in testing mode, then enforce. Set reverse DNS of the mail load balancer to mail.devantler.tech.

The SSO cookie's __Host- prefix is tracked in the companion naming issue and lands before Bulwark goes live.

Acceptance

  • Sign-in works from a fresh browser profile: GitHub SSO, then Stalwart login with two-factor.
  • Signing out forces credentials again.
  • The 15-minute idle limit fires.
  • The browser makes no third-party requests.
  • The CORS preflight from mail.platform… passes, and other origins get no CORS headers.
  • The SMTP greeting, autoconfig and the MTA-STS mx name mail.devantler.tech.
  • The collector and the diagnostic follow the new host.

Part of #5030. The research is in the maintainer's decision report of 2026-11-25. Sources: bulwarkmail/webmail, bulwarkmail.org/docs, stalw.art/docs, RFC 8314/8461/7489/6186, draft-ietf-mailmaint-autoconfig.

🤖 Generated with Claude Code

Activity

  1. coderabbitai commented on Nov 25, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #5482 - fix(homepage): show Stalwart with its logo under Email [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. devantler commented on Nov 25, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer (interactive Claude Code session)

    Step 1 done: Stalwart answers at stalwart.platform.devantler.tech

    #6664 merged at 19:35Z and was deployed by its merge-group run. Checked live at 19:40Z, read-only.

    Check Result
    HTTPRoute private-mail/private-mail generation 3: hosts mail.platform… and stalwart.platform…; Accepted at generation 3
    Public DNS (Cloudflare and Google DNS over HTTPS) A 49.12.20.241, AAAA 2a01:4f8:c01e:3486::1: the same gateway as mail.platform…, DNS-only (not Cloudflare-proxied). external-dns created both at 19:29:39Z
    TLS the certificate matches stalwart.platform.devantler.tech
    /admin, /account 302 to sign-in
    /.well-known/oauth-authorization-server 200
    /jmap/session without credentials 200 with no accounts and an empty username, the same 1,530-byte response as the old host (existing Stalwart behaviour)
    Preflight OPTIONS /jmap/ from Origin: https://mail.platform.devantler.tech 204, with Access-Control-Allow-Origin: https://mail.platform.devantler.tech, Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, Allow-Headers: Authorization, Content-Type, Accept, X-Requested-With, Max-Age: 600, Vary: Origin and HSTS
    GET from another origin Access-Control-Allow-Origin is still Bulwark's origin only, so browsers refuse it

    Carried into step 3: the JMAP session's apiUrl is still https://mail.platform.devantler.tech/jmap/. STALWART_PUBLIC_URL moves it, and the OAuth issuer, to stalwart.platform….

    Next:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions