Running a server
DNS records and TLS certificates
The records each domain needs (MX, SPF, DKIM, DMARC, autoconfiguration, SRV, WKD), how the console checks them, and how to get and renew certificates.
On this page
Each mail domain needs a few DNS records, and the mail host needs a matching address and reverse DNS. You do not have to work them out by hand: the admin console's Domains page lists every record with its exact value for your server and checks them live.
The examples use the domain example.org and the mail host mail.example.org with the address 203.0.113.25.
The mail host
| Record | Name | Value | Notes |
|---|---|---|---|
| A | mail.example.org | 203.0.113.25 | AAAA too if the host has IPv6. |
| PTR | 25.113.0.203.in-addr.arpa | mail.example.org | Set at your hosting provider, not in your zone. Must match hostname. |
Many receiving servers refuse or score down mail from an address whose reverse DNS does not name the sending host.
Required for mail
MX
example.org. MX 10 mail.example.org.Mail for example.org goes to the mail host. If you keep a backup MX with a lower number, the console warns that RustPost is not the first one.
SPF
example.org. TXT "v=spf1 mx -all"Says that only the hosts in the MX record may send for the domain. If you also send through a smarthost or another service, add it (for example include: of your relay). Publish only one SPF record per name.
DKIM
rsa-20261129._domainkey.example.org. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh…"RustPost signs outgoing mail with a 2048-bit RSA key per domain, and optionally with Ed25519 as well. Selectors are named after the creation date: rsa-YYYYMMDD and ed-YYYYMMDD. A domain's first keys are created automatically. Copy the exact value from the console, or print the records of the active keys on the command line:
docker compose exec rustpost rustpost domain dkim example.orgLong RSA values may need to be split into several quoted strings, depending on your DNS provider. Rotating keys is described in the admin guide.
DMARC
_dmarc.example.org. TXT "v=DMARC1; p=quarantine; rua=mailto:postmaster@example.org"Tells receivers what to do with mail that fails SPF and DKIM alignment, and where to send aggregate reports. The console warns about p=none (no protection) and about a missing rua.
Optional: setup for mail apps
These let mail apps configure themselves from an address and a password. See Client setup.
| Type | Name | Value |
|---|---|---|
| CNAME | autoconfig.example.org | mail.example.org. |
| CNAME | autodiscover.example.org | mail.example.org. |
| SRV | _submissions._tcp.example.org | 0 1 465 mail.example.org. |
| SRV | _imaps._tcp.example.org | 0 1 993 mail.example.org. |
| SRV | _autodiscover._tcp.example.org | 0 1 443 mail.example.org. |
Recommended as well, though the console does not check them yet: SRV records for calendar and contacts discovery (RFC 6764).
| Type | Name | Value |
|---|---|---|
| SRV | _caldavs._tcp.example.org | 0 1 443 mail.example.org. |
| SRV | _carddavs._tcp.example.org | 0 1 443 mail.example.org. |
The CNAMEs only work over HTTPS if the certificate names autoconfig.example.org and autodiscover.example.org (see below). Without them, clients still reach the settings through the mail host and the SRV records.
Encryption keys: WKD
openpgpkey.example.org. CNAME mail.example.org.The Web Key Directory lets other people's mail apps find your users' published OpenPGP keys. It is on by default for every domain, and the console lists this record when it is. The certificate must name openpgpkey.example.org.
The DNS check
Open a domain in the console (Domains, then the domain). The page:
- groups the records into Required for mail and Optional: setup for mail apps;
- shows each record's status: Correct, Needs attention, Missing, Wrong value or Couldn't check (a lookup timed out or failed);
- explains problems in plain words, for example an SPF record that does not authorize the server,
+all, several SPF records, DMARCp=none, or a DKIM record with another key; - checks the mail host's A and AAAA records and that each address's PTR names the host;
- has Check again and Copy all as zone file buttons.
Lookups run live, in parallel, with a 5-second limit each, and nothing is cached: a fixed record shows as correct as soon as your DNS serves it.


Not supported yet
MTA-STS (_mta-sts TXT and the mta-sts.<domain> policy), TLS reporting (_smtp._tls) and DANE (TLSA) are planned. RustPost does not yet serve an MTA-STS policy, and when it sends mail it uses opportunistic TLS without enforcing these policies.
TLS certificates
RustPost reads a certificate chain and key from the files in [tls]. Built-in ACME, with certificates managed from the admin console, is planned; until then use certbot or any ACME client.
The certificate must name:
- the mail host,
mail.example.org; - for each domain whose autoconfiguration or WKD you publish:
autoconfig.<domain>,autodiscover.<domain>andopenpgpkey.<domain>.
RustPost does not use port 80, so certbot's standalone mode can answer the challenge there (open port 80 in the firewall):
sudo certbot certonly --standalone \
-d mail.example.org \
-d autoconfig.example.org -d autodiscover.example.org -d openpgpkey.example.orgRenewal
certbot renews automatically. The server reads the files only at startup, so a deploy hook copies the new files into the compose directory and restarts the container:
sudo tee /etc/letsencrypt/renewal-hooks/deploy/rustpost.sh >/dev/null <<'EOF'
#!/bin/sh
set -e
DIR=/home/you/rustpost # the compose directory
cp "$RENEWED_LINEAGE/fullchain.pem" "$RENEWED_LINEAGE/privkey.pem" "$DIR/config/"
chown 999:999 "$DIR/config/fullchain.pem" "$DIR/config/privkey.pem"
chmod 600 "$DIR/config/privkey.pem"
cd "$DIR" && docker compose restart rustpost
EOF
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/rustpost.sh
sudo certbot renew --dry-runA restart closes open IMAP and webmail connections for a moment; clients reconnect on their own.