EmailMonitor

MTA-STS record and policy generator

Build the DNS record and policy file that make sending servers use TLS when delivering to your domain.

1. DNS record

Type TXT, host

2. Policy file

Serve at

3. Publish and verify

  1. Create the host mta-sts in your DNS and point it at a web host that can serve HTTPS with a valid certificate for that name.
  2. Upload the policy file to /.well-known/mta-sts.txt. It must be reachable without redirects and served as text/plain.
  3. Publish the TXT record above, and a TLS-RPT record from the TLS-RPT generator.
  4. Run the MTA-STS checker. It fetches the file, parses it and confirms every MX host is covered.

What MTA-STS protects against

SMTP between mail servers uses opportunistic TLS: if encryption fails or an attacker strips the STARTTLS offer, mail is delivered in plain text. MTA-STS (RFC 8461) lets your domain publish a policy saying "my MX hosts always support TLS with a valid certificate". Senders that support it, including Gmail and Microsoft 365, then refuse to deliver over an insecure connection or to a server whose certificate does not match one of the listed MX names.

Testing first, then enforce

In testing mode senders deliver as usual but report TLS failures to your TLS-RPT address. Watch those reports for one to two weeks. If they show no failures for legitimate MX hosts, switch the policy file to enforce, update the id in the TXT record, and keep the reports coming. To retire MTA-STS, publish mode: none with a new id and leave it in place for at least the old max_age before removing anything.

Common mistakes

Related tools

Get alerted when it changes

Free daily monitoring re-checks SPF, DKIM, DMARC, MX, BIMI and MTA-STS and emails you when something changes or fails.

Set up free monitoring

Frequently asked questions

Where do I host the MTA-STS policy file?

At https://mta-sts.yourdomain/.well-known/mta-sts.txt, served as text/plain with a valid certificate for mta-sts.yourdomain and without redirects. Any static host works: a Cloudflare Worker or Pages project, GitHub Pages with a custom domain, or your existing web server.

What should max_age be?

How long senders may cache the policy, in seconds. Use 86400 (one day) while testing and 604800 (one week) or more once enforced. RFC 8461 allows up to 31557600 (about a year).

When do I change the id?

Every time you edit the policy file. Senders re-fetch the file only when the id in the TXT record changes. Any unique string of letters and numbers works; a timestamp is common.

Do I need TLS-RPT too?

It is strongly recommended. TLS-RPT reports tell you when senders fail to establish TLS with your MX hosts, which is the only way to know enforce mode is safe. Use the TLS-RPT generator.

What do wildcards in mx: lines mean?

A leading *. matches exactly one label. mx: *.mail.protection.outlook.com matches yourdomain-com.mail.protection.outlook.com but not a.b.mail.protection.outlook.com.