Skip to main content
WebTools

MTA-STS rollout checklist

A step-by-step checklist for MTA-STS and TLS reporting: the policy file, the DNS records, testing mode and switching to enforce.

Published

Illustration of two mail servers joined by an encrypted tube with a padlock, and a checklist beside them.
On this page

The short answer: MTA-STS tells other mail servers that yours always support encrypted connections with a valid certificate, so they should refuse to deliver over an insecure connection. To roll it out, you publish a policy file on https://mta-sts.yourdomain/.well-known/mta-sts.txt, add a TXT record at _mta-sts, and turn on TLS reporting. Start in testing mode with a short max_age, read the reports, then switch to enforce.

This checklist goes through each part in order and covers the mistakes that most often break it.

What MTA-STS protects against

Email between servers is usually encrypted with STARTTLS, but by default the encryption is optional. An attacker who can interfere with the connection can strip the STARTTLS offer, and the sending server will fall back to sending in plain text. Most servers also don't check the receiving server's certificate, so a fake server can accept the mail.

RFC 8461 fixes this. A domain publishes a policy over HTTPS that lists its mail servers. Sending servers that support MTA-STS fetch the policy, cache it, and from then on deliver only over TLS to a server named in the policy with a valid certificate.

Diagram: a sending mail server checks the _mta-sts TXT record, fetches the policy file over HTTPS from mta-sts.example.com, then delivers only over TLS to a listed MX server with a valid certificate.
How a sending server uses your MTA-STS policy.

Before you start

  • Your MX servers must already support TLS with valid certificates. If you use Microsoft 365 or Google Workspace, they do.
  • You need somewhere to host one small text file over HTTPS on the mta-sts subdomain, with a valid certificate for that name.
  • You need to be able to add TXT records to your domain's DNS.

Step 1: turn on TLS reporting first

TLS reporting (TLS-RPT, RFC 8460) asks sending servers to send you a daily summary of failed encrypted connections. It's how you'll find out whether MTA-STS would block anything, so set it up first. Add a TXT record:

Name:  _smtp._tls
Type:  TXT
Value: v=TLSRPTv1; rua=mailto:tls-reports@yourdomain.com

Reports are JSON files. Like DMARC reports, they're easier to read with a reporting service.

Try it now

TLS-RPT Checker

Check a domain's TLS-RPT record (RFC 8460): whether it is valid and where mail servers send reports about failed secure connections.

Open the tool: TLS-RPT Checker

Step 2: publish the policy file in testing mode

Create a plain-text file, served at exactly this address:

https://mta-sts.yourdomain.com/.well-known/mta-sts.txt

with content like this:

version: STSv1
mode: testing
mx: yourdomain-com.mail.protection.outlook.com
max_age: 86400
  • version is always STSv1.
  • mode is testing, enforce or none. In testing mode, senders report problems but still deliver.
  • mx lists every mail server in your MX records, one per line. A wildcard such as *.mail.protection.outlook.com matches one level of subdomain.
  • max_age is how long senders cache the policy, in seconds. The NCSC recommends 86400 (one day) while testing.

Step 3: add the _mta-sts TXT record

This record tells senders that a policy exists and which version it is:

Name:  _mta-sts
Type:  TXT
Value: v=STSv1; id=20261104T0900

The id can be any short string of letters and numbers. A date and time works well. Change it every time you change the policy file; that's how senders know to fetch the new version. If you forget, senders keep using their cached copy until it expires.

Try it now

MTA-STS Checker

Check a domain's MTA-STS setup: the DNS record, the policy file, its mode and max_age, and whether every MX server matches the policy.

Open the tool: MTA-STS Checker

Step 4: check everything matches

  1. Look up your MX records and compare them with the mx lines in the policy. Every MX host must match a line.
  2. Run the MTA-STS Checker. It fetches the policy the way a sending server would, checks the TXT record, and compares the mx lines with your MX records.
  3. Run the TLS-RPT Checker to confirm the reporting record is valid.

Step 5: watch the reports, then enforce

Leave the policy in testing mode for at least two weeks. Check the TLS reports for failures. Typical causes are an MX server missing from the policy, an expired certificate on one of your mail servers, or a backup MX that doesn't support TLS.

When the reports are clean:

  1. Change mode: testing to mode: enforce.
  2. Raise max_age. The NCSC recommends at least 1209600 (two weeks) when enforcing; the maximum the standard allows is 31557600 (about a year).
  3. Change the id in the _mta-sts TXT record.

Changing mail provider later

MTA-STS policies are cached, which is the point, but it means a change of mail provider needs planning. Senders that have cached an enforce policy won't deliver to a new server that isn't listed, until their copy expires.

  1. Several days before the move, add the new provider's MX hosts to the policy alongside the old ones, and change the id.
  2. Wait at least as long as the old max_age, so senders have fetched the new policy.
  3. Switch your MX records.
  4. Remove the old provider's hosts from the policy and change the id again.

The mistakes we see most often

  • A redirect on the policy address. Many hosts redirect every subdomain to the main website. Senders won't follow it, so the policy is never read.
  • A certificate that doesn't cover mta-sts. A certificate for www and the bare domain isn't enough; the policy host needs its own name on a valid certificate.
  • A forgotten backup MX. Older set-ups sometimes have a second, lower-priority MX record at another provider. It must be in the policy and must support TLS, or be removed.
  • The id never changes. Senders keep using the old policy, so a fix seems to make no difference.
  • Extra text in the file. Keep the file to the four kinds of line shown above, each on its own line, with no HTML around it.

Common questions

Does MTA-STS protect the mail I send?

No. Your MTA-STS policy protects mail that other people send to you. Whether your outgoing mail is protected depends on your mail provider honouring other domains' policies when it delivers.

Do I need DNSSEC for MTA-STS?

No. MTA-STS was designed to work without DNSSEC: it relies on the HTTPS certificate on the mta-sts name instead. DANE is an alternative that does need DNSSEC. Some domains use both.

What happens if the policy file goes offline?

Senders that already have a cached policy keep using it until max_age runs out, so mail keeps flowing. New senders that can't fetch the policy simply deliver as they would without MTA-STS. That's why a longer max_age matters once you're enforcing.

Can I host the policy on my normal website?

Yes, as long as the mta-sts subdomain points to it, the server has a valid certificate for mta-sts.yourdomain, and the file is served directly at the /.well-known/mta-sts.txt address without redirects. Many hosts let you add the subdomain in their control panel.

The full checklist

  • TLS-RPT record at _smtp._tls with a working report address.
  • Policy file at https://mta-sts.yourdomain/.well-known/mta-sts.txt, served with 200, no redirects, valid certificate.
  • Every MX host matched by an mx line.
  • _mta-sts TXT record with v=STSv1 and an id.
  • Testing mode for two weeks or more, with clean reports.
  • Enforce mode with a longer max_age, and a new id after every change.
  • MTA-STS Checker

    Check a domain's MTA-STS setup: the DNS record, the policy file, its mode and max_age, and whether every MX server matches the policy.

  • TLS-RPT Checker

    Check a domain's TLS-RPT record (RFC 8460): whether it is valid and where mail servers send reports about failed secure connections.

  • MX Lookup

    Find which mail servers receive email for a domain: MX records in priority order, each host's IPv4 and IPv6 addresses, null MX and common mistakes.