Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Learn

MTA STS and TLS-RPT: how to set them up

MTA-STS (RFC 8461) lets a domain tell sending mail servers to deliver only over TLS to the MX hosts it names, with a valid certificate. TLS-RPT (RFC 8460) adds daily JSON reports on TLS failures. Together they need two DNS TXT records and one HTTPS policy file.

The short answer
  • Protects inbound mail from STARTTLS downgrade and from impostor MX hosts.
  • Needs an HTTPS site at mta-sts.yourdomain serving /.well-known/mta-sts.txt.
  • Start in mode testing, watch TLS-RPT, then switch to enforce.
Try the mx lookupFree, live, no signup

How do you deploy MTA-STS?

  1. 01

    Verify MX TLS

    Each MX host needs STARTTLS and a certificate that is valid, not expired, trusted and matching its name. Use the MX lookup to list the hosts.

  2. 02

    Publish TLS-RPT first

    TXT at _smtp._tls.yourdomain so you receive reports from the start.

  3. 03

    Host the policy file

    HTTPS at mta-sts.yourdomain/.well-known/mta-sts.txt with a valid certificate. No redirects.

  4. 04

    Publish the _mta-sts TXT

    v=STSv1; id=something unique. Change id whenever the policy changes.

  5. 05

    Run in testing mode

    Delivery continues on failures, and you see them in reports.

  6. 06

    Switch to enforce

    After clean reports, set mode: enforce and update the id.

What do the records and policy file look like?

DNS and the policy at https://mta-sts.example.com/.well-known/mta-sts.txt
_mta-sts.example.com.   IN TXT "v=STSv1; id=20261121T000000"
_smtp._tls.example.com. IN TXT "v=TLSRPTv1; rua=mailto:tlsrpt@example.com"

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

What are the policy modes?

RFC 8461, section 3.2
ModeSending server behaviorWhen to use
testingDelivers anyway; implementations with TLS-RPT should report failuresFirst weeks
enforceMust not deliver to MX hosts that fail MX matching, certificate or STARTTLS checksAfter clean reports
nonePolicy treated as removedOpting out

max_age is in seconds, maximum 31557600. RFC 8461 expects values of weeks or longer for real deployments.

Expired certificate means lost mail

In enforce mode an expired MX or policy-host certificate can make senders refuse to deliver. SSL monitoring catches expiry on the mta-sts host before senders do.

What do reports tell you to fix?

  • certificate-expired or certificate-not-trusted on an MX host
  • certificate-host-mismatch, where the certificate name does not match the MX hostname
  • starttls-not-supported on a host that should offer TLS
  • sts-policy-fetch-error or sts-webpki-invalid, meaning senders cannot read or trust the policy file

What does RFC 8461 require of the policy host?

Valid HTTPS

The certificate must be valid for mta-sts.yourdomain, unexpired and chain to a trusted root.

HTTP 200 only

Senders accept only 200 responses, follow no redirects and do not use HTTP caching.

MX patterns

Each mx line is a hostname or a wildcard covering only the leftmost label.

How do MTA-STS and DANE compare?

Two ways to secure inbound SMTP
ItemMTA-STSDANE
Trust anchorWeb PKI certificate authoritiesDNSSEC and TLSA records
Needs DNSSECNoYes
PublicationDNS TXT plus HTTPS policy fileTLSA records in DNS
Both togetherRFC 8461 says MTA-STS must not override a failing DANE validationNot applicable

What should you check before enabling enforce?

  • Every MX host has a certificate valid for its own hostname
  • Certificates renew automatically and expiry is monitored
  • The policy file lists every MX host you use, including backups
  • TLS-RPT reports have been clean for at least a few weeks
  • The id changes whenever you edit the policy
  • Someone owns the renewal of the mta-sts web host and its certificate

Common questions

What is MTA-STS?

SMTP MTA Strict Transport Security, defined in RFC 8461. A domain publishes a policy naming its MX hosts and requiring TLS with valid certificates, so sending servers cannot be tricked into plain-text delivery.

What is TLS-RPT?

SMTP TLS Reporting, RFC 8460. A TXT record at _smtp._tls.yourdomain asks senders to deliver daily JSON reports of TLS successes and failures, including result types such as certificate-expired and starttls-not-supported.

Do I need MTA-STS if I already have DMARC?

They address different things. DMARC authenticates who sent a message. MTA-STS protects the connection used to deliver mail to you. Neither replaces the other.

How do I change an MTA-STS policy?

Edit the policy file and change the id in the _mta-sts TXT record. Senders cache the policy for max_age seconds and only refetch when the id changes.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.