What MTA-STS and TLS-RPT do
MTA-STS makes sure mail to your domain is delivered only encrypted and only to your real mail servers. TLS-RPT tells you when that fails.
How it works
Mail servers mostly encrypt between each other voluntarily. An attacker in the network can suppress the encryption or redirect mail. With MTA-STS (Mail Transfer Agent Strict Transport Security) you define: delivery only with a valid TLS certificate and only to the servers named.
MTA-STS has two parts. A TXT record at _mta-sts.<your domain> announces the policy:
v=STSv1; id=20261002
The policy itself is a file at https://mta-sts.<your domain>/.well-known/mta-sts.txt:
version: STSv1
mode: testing
mx: mail.your-domain.example
max_age: 604800
TLS-RPT (TLS Reporting) is another TXT record, at _smtp._tls.<your domain>. Sending servers report to the address in it when encrypted delivery fails:
v=TLSRPTv1; rua=mailto:tlsrpt@your-domain.example
What matters
- A new
idwith every change. Sending servers only reload the policy when theidchanges. - A valid certificate for
mta-sts. The subdomain must be reachable over https with a valid certificate. - Every mail server under
mx. Each server from your MX records must match; wildcards like*.provider.exampleare allowed. mode: enforcein the end. Withtestingfailures are only reported, nothing is enforced.
How to set it up
- Put the policy file with
mode: testingon the subdomainmta-sts. Usually whoever runs your website does this. - Enter the MTA-STS record and the TLS-RPT record in the DNS settings of your domain.
- If the reports stay clean for a few weeks, switch to
mode: enforceand raise theid.