MTA-STS check and generator

Check a domain's MTA-STS record, policy file and MX coverage, and generate the record and policy file from its MX hosts. TLS-RPT included.

Free, no account. The domain is kept only in a short cache.

Run the full email security check DMARC, SPF, DKIM, MX and MTA-STS in one free report.

How it works

Enter a domain and the tool runs the same MTA-STS check as the email security check. MTA-STS has two parts, and the check reads both:

  • The DNS record. It looks up the TXT record at _mta-sts.DOMAIN. There must be exactly one record that starts with v=STSv1, and it must carry an id of 1 to 32 letters and digits. Senders use the id to notice that the policy changed.
  • The policy file. It fetches https://mta-sts.DOMAIN/.well-known/mta-sts.txt and parses version, mode (enforce, testing or none), the mx patterns and max_age.

It then looks up the domain's MX records and compares each host with the mx patterns of the policy. A host that no pattern matches would fail delivery under enforce. Finally it reads the TLS-RPT record at _smtp._tls.DOMAIN, which must start with v=TLSRPTv1 and give at least one rua address with mailto: or https:.

From the same MX hosts the generator builds what you need to publish: the policy file in testing mode, the policy file for enforce later, the _mta-sts TXT record with a fresh id, and a TLS-RPT record if the domain has none. The MTA-STS and TLS-RPT guide explains the protocol in more depth.

How the policy is fetched

The fetch behaves as RFC 8461 requires a sender to behave. The certificate is verified against mta-sts.DOMAIN, redirects are never followed, only status 200 with text/plain is accepted, and the file may be at most 64 KB. The check only connects to addresses of mta-sts.DOMAIN that are public unicast addresses. If the file cannot be fetched, that is reported as a finding with the reason, and the rest of the result is still returned.

A safe rollout

  1. Serve the testing policy and publish the record. Senders that support MTA-STS keep delivering but report TLS problems.
  2. Publish the TLS-RPT record and read the daily reports for a few weeks.
  3. Switch the file to mode: enforce, raise max_age and publish a new id.
  4. Whenever the MX records change, update the mx lines first, then the id.

Common mistakes

  • A missing MX host. A new mail server that is not in the policy is refused by senders under enforce (MTASTS_MX_NOT_COVERED).
  • The id not changed. Senders cache the policy for max_age seconds and only fetch it again when the id changes.
  • The wrong certificate on mta-sts.DOMAIN. A certificate for the main site or a redirect to www makes the policy unreachable (MTASTS_POLICY_UNAVAILABLE).
  • Testing forever. mode: testing protects nothing; it only reports.
  • A very short max_age. Below one day (MTASTS_LOW_MAX_AGE) the policy gives little protection between visits.

Limitations

  • The check does not connect to your mail servers on port 25, so it does not test whether they offer STARTTLS or which certificate they present.
  • It reads the policy as served at the time of the check. Senders that cached an older policy keep using it until its max_age runs out.
  • TLS-RPT reports themselves are not read; the check only validates the record that asks for them.

Use it from code

The same check is available as an API: $0.02 per check. See the API reference.

curl -i "https://api.lookproof.dev/v1/mail/mta-sts?domain=example.com"

A request without payment is answered with 402 Payment Required and the exact price.

Frequently asked questions

What is the difference between MTA-STS and TLS-RPT?

MTA-STS (RFC 8461) lets a domain tell sending servers that its mail servers support TLS with a valid certificate, and that delivery should fail instead of falling back to plain text. TLS-RPT (RFC 8460) asks senders to send daily reports about TLS problems they met while delivering to the domain. They are independent, but TLS-RPT is how you find out whether an MTA-STS policy causes trouble.

Why does the check report that the policy cannot be fetched?

The policy file must be served at https://mta-sts.DOMAIN/.well-known/mta-sts.txt with a certificate that is valid for that host name, status 200 and the content type text/plain. A redirect, a certificate for another name, an HTML error page or a missing host all make senders ignore the policy. The evidence of MTASTS_POLICY_UNAVAILABLE names the reason.

Should I start in testing mode?

Yes, that is what mode: testing is for. Senders that support MTA-STS then report failures through TLS-RPT but still deliver. Once the reports show that all your MX hosts pass, you can move to mode: enforce. The check reports testing mode so it is not forgotten, and the generator gives you both files: one for testing and one for enforce.

Does a wildcard in the policy cover my MX hosts?

A pattern such as *.example.net matches exactly one extra label, so it covers mx1.example.net but not example.net itself or a.b.example.net. The check compares every MX host of the domain against the patterns and lists the ones that are not covered.

How is the policy generated?

From the MX records the check finds for the domain. Every MX host is listed by its exact name in an mx: line, in the order of the MX records, and the record gets an id made of the current date and time in UTC. The generated files are read back with the same parser and coverage rule as the check, so they pass it as soon as they are published.

Is the domain stored?

No. Results are kept in memory for up to ten minutes so repeated lookups are fast, and are then gone. The domain is not written to logs and no account is needed.