Guides · Email security · Updated 2026-12-04

Set up MTA-STS and TLS-RPT

Without MTA-STS, an attacker on the network can make sending servers deliver email to you unencrypted. MTA-STS publishes a policy that says: only deliver to these mail servers, and only over valid TLS.

1. Publish the policy file

Serve a text file over HTTPS at https://mta-sts.example.com/.well-known/mta-sts.txt with a valid certificate. List every MX host. Start in testing mode.

version: STSv1
mode: testing
mx: mx1.example.com
mx: *.mail.example.net
max_age: 86400

2. Add the DNS record

A TXT record named _mta-sts. Change the id every time you change the policy file.

_mta-sts.example.com  TXT  "v=STSv1; id=20261204"

3. Add TLS-RPT

Receive daily reports about failed encrypted deliveries.

_smtp._tls.example.com  TXT  "v=TLSRPTv1; rua=mailto:tlsrpt@example.com"

4. Switch to enforce

After a couple of weeks without failures in the reports, change mode to enforce, raise max_age to 604800 or more, and update the id in DNS.

Questions

Where do I host the policy file without a web server?
Any static host with HTTPS on the mta-sts subdomain works, for example a free static-site host or a Cloudflare Worker.
Does Microsoft 365 or Google support MTA-STS?
Both honour MTA-STS when sending. For receiving, you publish the policy for your own domain as described here.

General technical information, not legal advice or a security audit. Record values shown are examples: use the exact values from your own email provider.