Skip to Content
Bryfo Docsv0.2.1

Managed Mail Server (Stalwart v1.2.1)

Host custom-domain mailboxes via the optional Stalwart v1.2.1 JMAP sidecar and automated DNS verification.

Bryfo can provision and manage custom-domain mailboxes through /admin/mailserver over standard HTTP/JMAP (urn:stalwart:jmap), IMAP, and SMTP while keeping Bryfo itself 100% MIT licensed.

1. Headless Sidecar Bootstrap

cd deploy
./stalwart-bootstrap.sh mx.example.com
docker compose -f docker-compose.yml -f docker-compose.mailserver.yml up -d
  • Network Isolation: stalwart attaches only to mailserver-internal (shared with app), keeping postgres and valkey isolated on the backend network.
  • Persistent Volumes: Back up both stalwart-etc (/etc/stalwart) and stalwart-data (/var/lib/stalwart, UID/GID 2000).
  • Zero :80 / :443 Conflict: Exposes 0.0.0.0:25 (inbound MX) and loopback 127.0.0.1:465 / 127.0.0.1:993 (BRYFO_MAIL_CLIENT_BIND_IP) plus 127.0.0.1:18095 for ACME /.well-known/acme-challenge/ proxying.

2. Domain DNS & Mailbox Policies

  1. Connect Stalwart in /admin/mailserver (POST /api/v1/admin/mailserver/test verifies JMAP, IMAP, and SMTP non-destructively).
  2. Add your domain (ed25519 or rsa2048 DKIM), publish the generated _bryfo-verify TXT, MX, SPF, DKIM, and DMARC records, and run Verify DNS ( ensure VPS IPv4/IPv6 PTR records match mx.example.com).
  3. Keep admin_only allocation for private assignment, or switch verified domains to self_claim with per-user mailbox caps (1–50), storage quotas, minimum plan tiers, and custom reserved localparts.
  4. In self_hosted mode, optionally enable external IMAP/SMTP client access to issue per-mailbox one-time AppPassword credentials (cloud mode keeps external submission disabled so sending limits and circuit breakers cannot be bypassed).

On this page