Skip to content

MTA-STS is not published

Nothing tells sending servers to refuse an unencrypted delivery to your domain

Warning
Email Transport Security
MTA-STS
RFC 8461

Warning when a domain with MX records has no MTA-STS record, or has one that does not parse. Domains with no MX, or only a null MX, are not checked.

What the scan found

The domain accepts mail (it has MX records), but there is no valid MTA-STS TXT record at _mta-sts.{domain}. Sending servers therefore have no policy that tells them to require TLS when they deliver to your mail servers.

What MTA-STS does

Server-to-server email is encrypted opportunistically. A sending server asks the receiving server whether it supports STARTTLS, and if the answer is no, or if there is no answer, it sends the message in plaintext anyway. Someone on the network path can remove the STARTTLS offer from that conversation. Neither side sees an error, and the message crosses the network readable.

MTA-STS (RFC 8461) closes that gap with a published policy. The sender learns that a policy exists from a TXT record, fetches the policy over HTTPS, and from then on will only deliver to the MX hosts the policy lists, over TLS, with a certificate that is valid for the host name. If a connection cannot meet that bar, the message is held and retried instead of being sent in clear.

The policy is cached for the period you set in max_age. That cache is what protects you when an attacker later interferes with DNS or with the connection.

How it differs from DANE

DANE for SMTP (RFC 7672) has the same goal. It publishes the expected certificate in TLSA records and relies on DNSSEC to make those records trustworthy. That makes it strong, and it also means the domain and its mail hosts must be DNSSEC-signed before it can work.

MTA-STS needs no DNSSEC. It anchors trust in the public certificate authority system and in the HTTPS policy fetch instead. The trade-off is that the very first fetch for a domain is not protected, because there is no cached policy yet. Both can run side by side, and sending servers that support DANE will use it first.

If your zone is not signed and signing it is not on the roadmap, MTA-STS is the realistic way to get enforced transport encryption.

How to deploy it

There are two parts: a policy file served over HTTPS, and a TXT record that announces it.

1. Serve the policy file

Publish a host named mta-sts under your domain with a valid certificate, and serve the file at the well-known path:

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

The file is plain text, with mx lines for each mail host you accept mail on:

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

Every MX host in your DNS must match one of the mx lines, and the certificate on each of those hosts must be valid for the name that matches. A forgotten backup MX is the usual cause of trouble.

2. Publish the TXT record

_mta-sts.example.com.  IN  TXT  "v=STSv1; id=20260101T000000"

The id is 1 to 32 letters or digits. Senders compare it with the one they cached, so change it every time you change the policy file, or they will keep using the old policy until it expires. A timestamp is a convenient choice. Publish exactly one record: with two, senders discard the policy.

Testing first, enforce as the goal

The mode line sets what senders do when a delivery fails the policy:

  • testing: senders still deliver, and report the failures if you also publish TLS-RPT. This is the safe way to start.
  • enforce: senders refuse to deliver when TLS or the certificate check fails. This is the goal, and the point where MTA-STS actually protects you.
  • none: the policy is switched off, for retiring MTA-STS cleanly.

A reasonable rollout: publish a _smtp._tls TLS-RPT record, deploy MTA-STS in testing with a short max_age, read the reports for a few weeks, fix every host that fails, then switch to enforce and raise max_age to a week or more. Moving to enforce without the data is how mail gets refused by accident.

What this check reads

The scan looks up the TXT record at _mta-sts.{domain} and checks that it begins with v=STSv1 and has a valid id. It reports three states:

  • Not published: a Warning. No policy is announced.
  • Malformed: a Warning. The record has no id, an id that is too long or uses other characters, or more than one record begins with v=STSv1.
  • Lookup failed: reported as not assessed, with no effect on the grade. A failed lookup is never treated as a missing record.

A valid record passes. The scan does not fetch the policy file, so a passing result means the record is published correctly, not that the policy behind it is reachable or set to enforce. Check that with curl https://mta-sts.example.com/.well-known/mta-sts.txt.

How this is rated

A missing or malformed MTA-STS record is a Warning and counts toward the DNS grade. Mail still flows without it, but the domain has no defence against a downgrade of inbound transport encryption, and the fix is a small one.

References: RFC 8461 (MTA-STS) · RFC 7672 (DANE for SMTP) · RFC 8460 (TLS-RPT) · RFC 7505 (null MX)