HTTPfy

MTA-STS record

MTA-STS lets a domain tell sending mail servers to deliver only over TLS with a valid certificate, and to refuse delivery rather than fall back to plaintext.

stored as TXT RFC 8461

Live MTA-STS records from real domains

Checked at via public DNS
_mta-sts.gmail.comTXT
_mta-sts.gmail.com. 249 IN TXT "v=STSv1; id=20190429T010101;"
  ; MTA-STS policy announced; the id changes whenever the policy file changes
_mta-sts.google.comTXT
_mta-sts.google.com. 300 IN TXT "v=STSv1; id=20210803T010101;"
  ; MTA-STS policy announced; the id changes whenever the policy file changes
_mta-sts.microsoft.comTXT
_mta-sts.microsoft.com. 3600 IN TXT "v=STSv1; id=20190225000000Z;"
  ; MTA-STS policy announced; the id changes whenever the policy file changes

What the MTA-STS record does

SMTP encryption (STARTTLS) is opportunistic: an attacker who can strip the STARTTLS offer or present any certificate can read mail in transit. MTA-STS closes that gap. The TXT record at _mta-sts.<domain> announces that a policy exists, and the policy itself is served over HTTPS from https://mta-sts.<domain>/.well-known/mta-sts.txt, which ties it to the web PKI rather than to DNS alone.

Senders cache the policy for max_age seconds and re-fetch it when the id in the TXT record changes. In enforce mode they deliver only to MX hosts that match an mx: line and present a valid certificate for that name.

Zone-file syntax

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

# https://mta-sts.example.com/.well-known/mta-sts.txt
version: STSv1
mode: enforce
mx: mx1.example.com
mx: *.mail.example.net
max_age: 604800

Wire format: A TXT record plus a text/plain file over HTTPS. Redirects on the policy URL must not be followed.

Fields

FieldMeaning
vSTSv1.
id1-32 letters/digits; change it on every policy update.
modeenforce, testing (report only) or none (withdraw).
mxAllowed MX host; *. matches exactly one leftmost label. Repeat for each host.
max_ageCache lifetime in seconds, up to 31557600 (one year).

Common mistakes

  • An mx line that does not cover a new MX host after switching providers: enforcing senders stop delivering.
  • No valid certificate on mta-sts.<domain>.
  • Updating the policy file but not the id, so senders keep using their cached copy.

Specification

  • RFC 8461: SMTP MTA Strict Transport Security (MTA-STS)

Related record types

  • TLS-RPT: reports on failed TLS mail delivery
  • MX: where email for a domain is delivered
  • TLSA: DANE certificate pinning in DNS

All DNS record types