DNS records
Other mail servers decide whether to trust your mail by looking at DNS. Here is every record Synth Mail uses, with
example.com as the domain, mail.example.com as the server and 203.0.113.10 as its public address.
Required
| Record | Name | Value | Why |
|---|---|---|---|
| A | mail.example.com | 203.0.113.10 | the server's name; the HTTPS certificate is issued on it |
| PTR | 203.0.113.10 | mail.example.com | reverse DNS, set in your provider's panel; without it Gmail and Outlook reject mail |
| MX | example.com | 10 mail.example.com | where other servers deliver mail for @example.com |
| TXT (SPF) | example.com | v=spf1 ip4:203.0.113.10 -all | only this address sends mail for the domain |
| TXT (DKIM) | mail._domainkey.example.com | v=DKIM1; k=rsa; p=... | the public key; outgoing mail carries a signature checked against it |
| TXT (DMARC) | _dmarc.example.com | v=DMARC1; p=none; rua=mailto:postmaster@example.com | what receivers do when SPF and DKIM fail, and where to send reports |
DKIM
The key is created on the first start and kept in the data volume (/app/data/dkim-keys). The start log prints
the record:
DKIM DNS record — TXT mail._domainkey.example.com: v=DKIM1; k=rsa; p=MIIBIjANBgkq...
Keep the data volume in your backups: a lost key means a new key and a new DNS record. With several domains in
MAIL_DOMAINS the same key signs mail of each — publish the same value under mail._domainkey.<domain> of every
domain.
DMARC
Start with p=none: receivers only send reports to postmaster@ and change nothing. When "Show original" in Gmail
shows DMARC: PASS for a couple of weeks, tighten it to p=quarantine (failed mail goes to spam) and later to
p=reject. postmaster@ and abuse@ exist in every domain of the server from the first start.
Recommended: MTA-STS and TLS-RPT
MTA-STS tells other servers to deliver to you only over a verified TLS connection; TLS-RPT asks them to report problems.
| Record | Name | Value |
|---|---|---|
| A or CNAME | mta-sts.example.com | the server (same as mail.example.com) |
| TXT | _mta-sts.example.com | v=STSv1; id=20261116 (change id whenever the policy changes) |
| TXT | _smtp._tls.example.com | v=TLSRPTv1; rua=mailto:postmaster@example.com |
Synth Mail serves the policy at https://mta-sts.example.com/.well-known/mta-sts.txt. mta-sts.example.com
needs an HTTPS certificate on that name: the install compose file issues one only for MAIL_HOSTNAME, so add the
name to the lego command (--domains "$$MAIL_HOSTNAME" --domains mta-sts.example.com) or serve it through your own
reverse proxy. Mode: MAIL_MTA_STS_MODE — start with testing, switch to enforce
when the reports are clean (Configuration).
Several domains
Every domain in MAIL_DOMAINS needs its own MX, SPF, DKIM and DMARC records — all pointing at the same server.
The A and PTR records exist once, for mail.example.com.
Check
dig +short MX example.com
dig +short TXT example.com
dig +short TXT mail._domainkey.example.com
dig +short TXT _dmarc.example.com
dig +short -x 203.0.113.10