1. The problem: STARTTLS can be silently stripped
Mail servers encrypt connections with the STARTTLS command, but they do it opportunistically:
- if the receiving server does not advertise STARTTLS, the sender delivers the mail unencrypted;
- the receiving server's certificate is usually not checked, so any certificate will do.
An attacker who can interfere with network traffic removes the STARTTLS announcement from the server's reply (downgrade) or puts up their own server with a fake certificate. The sender has no way of noticing.
2. How MTA-STS works
MTA-STS (RFC 8461) lets the domain owner announce: "my mail arrives only over TLS, to these MX servers, with a valid certificate". It has two parts:
A TXT record signalling that a policy exists (and its version):
_mta-sts.company.com. IN TXT "v=STSv1; id=20261126"A policy file available over HTTPS at a fixed address, https://mta-sts.company.com/.well-known/mta-sts.txt:
version: STSv1
mode: enforce
mx: mx1.company.com
mx: mx2.company.com
max_age: 604800A sending server that supports MTA-STS fetches the policy, caches it for max_age and from then on delivers mail only to the listed MX servers, over TLS, with a certificate matching the server name.
| Mode | Behaviour |
|---|---|
none | Policy disabled (used when withdrawing it) |
testing | Senders deliver mail as usual but report problems via TLS-RPT |
enforce | Senders will not deliver mail if TLS or the certificate does not match |
3. TLS-RPT: reports on encryption problems
TLS-RPT (RFC 8460) is a record telling senders where to send daily reports about failed TLS connections:
_smtp._tls.company.com. IN TXT "v=TLSRPTv1; rua=mailto:[email protected]"The reports show, for example, an expiring or mismatched certificate before mail starts getting lost. Without TLS-RPT, an MTA-STS rollout is done blind.
4. Rolling it out step by step
- Check your MX servers: each must support STARTTLS and have a valid certificate (e.g. Let's Encrypt) issued for the name in the MX record.
- Enable TLS-RPT to get reports from the start.
- Publish the policy in
testingmode and the_mta-stsrecord. - Read the TLS-RPT reports for 2–4 weeks and fix the reported problems.
- Switch the policy to
enforceand change theidin the TXT record so senders fetch the new version. - Every change of MX servers requires updating the policy file and the
id; otherwise senders will reject the new server.
Hosted mail
If your mail is handled by an external service (e.g. Microsoft 365 or Google Workspace), check its documentation: the MX names in the policy file must match the provider's certificates. You host the policy file yourself, under the mta-sts subdomain of your domain.
5. MTA-STS and DANE
The alternative is DANE (TLSA records), which pins the certificate in DNS. It requires DNSSEC for the domain and the MX servers, so it is less common. Both mechanisms can be used at the same time.
6. Checking with MailSpecto
The domain audit in the panel checks whether the MTA-STS and TLS-RPT records are published. The mail server analysis for domains verified with a TXT record also fetches the MTA-STS policy file, compares it with the MX records and checks STARTTLS, the TLS version, the certificate and the DANE records of each server.
- Every MX server supports STARTTLS with a valid certificate.
- Publish TLS-RPT with a report address.
- Start with
mode: testing, then move toenforceafter reviewing reports. - On every MX change, update the policy file and the
idin the TXT record.
Keep your contact list clean
Verify email addresses before you send, and explore our upcoming SPF/DKIM/DMARC diagnostics module.
MailSpecto Engineering Team
We build tools for email address verification, deliverability monitoring and mail infrastructure security diagnostics for companies in Poland and Europe.