Mail server
The federation's own mail server (Stalwart), so people get name@your-domain addresses.
A federation can give people addresses name@<mail domain>. For that the bundled Stalwart mail
server runs beside it, and the federation creates the mailboxes on it itself. People need no
mailbox password: Comon connects to the mailbox on its own, and other mail apps use app passwords
the person makes. If your domain's mail already runs on a server of yours, you need nothing on this
page: name its IMAP and SMTP in Administration → Modules → Mail → Own mail server.
The full operator procedure is in the mail server runbook.
Ports
| Port | Published | What |
|---|---|---|
| 25 | yes | SMTP: mail from other servers |
| 465 | yes | submission over TLS |
| 993 | yes | IMAP over TLS |
| 8080 | no | web administration and the management API |
The management API is never published: only the federation reaches it, on the stack's internal network.
Starting it
- Copy
compose.mail.yamlfromdeploy/hosted(ordeploy/mvp) into the state directory and addCOMON_MAIL_HOST=mail.example.orgtostack.env. - Start the stack (
prepare-hosted-stack.py upormvp-stack.py up). Stalwart starts in setup mode and prints a temporary administrator in its log. - Open
/adminthrough an SSH tunnel to port 8080 (never a public address), finish the setup and keep the permanent administrator insecrets/. - Create an API key for the federation with the administrator's permissions and keep it as
secrets/mail/api-key(mode 0600). - Add
COMON_MAIL_SERVERandCOMON_MAIL_SERVER_KEY_FILEtostack.envand runupagain. - In the federation's mail settings, choose the bundled server and the mail domain.
People whose role holds «Federation mail address» can then claim <username>@<domain>.
DNS and TLS
- The domain's
MXpoints toCOMON_MAIL_HOST, which hasA/AAAArecords. - SPF (
v=spf1 mx -all), DKIM at the selector Stalwart generated, and_dmarc(start withp=none). - The server address's reverse DNS (PTR) is
COMON_MAIL_HOST. Without it, mail is often rejected. - Many hosting providers block outbound port 25 by default: ask them to open it in advance.
The stack's reverse proxy holds ports 80 and 443, so get the certificate for COMON_MAIL_HOST
with ACME DNS-01 in Stalwart itself, or mount certificate files. The federation verifies the mail
server's certificate, so it must be in place before people claim addresses.
Letters from the federation
The federation sends its own letters (such as invitations to guests by e-mail) from a noreply@
sender. With the bundled server it is noreply@<domain>; another server can be named with the
--mail-noreply-* flags (reference). An administrator turns the letters on in the
federation's mail settings and can send a test letter there.
Backups and upgrades
The mail volume is the whole mail server. prepare-hosted-stack.py backup archives it with the
rest (backups). Letters that arrive while the server is down wait at the senders'
servers and come later. Change the Stalwart version in both compose.mail.yaml files at once,
after reading its upgrade notes and taking a backup.