CertaDNS
Skip to lesson

MTA-STS · lesson 2 of 3

Reading a policy file

After this lesson you can

Read any published policy and say exactly which hosts it permits and for how long.

Assumes you have read Three pieces, three failure points.

A policy file is four kinds of line. Reading one tells you which hosts a sender will accept for your domain and how long it will hold you to that.

The fields

FieldValuesMeaning
versionSTSv1The only version.
modeenforce, testing, noneWhat a sender does when the policy is not satisfied.
mxA hostname, or a wildcard on the leftmost labelRepeatable. The complete list of permitted MX hosts.
max_ageSeconds, up to 31557600How long a sender caches this policy.

Two live policies

$ curl -s https://mta-sts.gmail.com/.well-known/mta-sts.txt
version: STSv1
mode: enforce
mx: smtp.google.com
mx: gmail-smtp-in.l.google.com
mx: *.gmail-smtp-in.l.google.com
max_age: 86400
Checked 2026-09-15.
$ curl -s https://mta-sts.outlook.com/.well-known/mta-sts.txt
version: STSv1
mode: enforce
mx: *.olc.protection.outlook.com
max_age: 604800
Checked 2026-09-15.

The difference in max_age is the interesting part. Gmail commits for a day; Outlook for a week. A shorter value means senders refetch more often and you can change your MX hosts sooner — at the cost of more traffic to your policy host and a shorter window of protection if that host goes down.

The three modes

ModeA sender that cannot satisfy the policy…
enforceDoes not deliver. This is the point of the mechanism.
testingDelivers anyway, and reports the failure via TLS-RPT.
noneIgnores the policy. Used to withdraw one that senders have cached.

testing is not a lesser deployment — it is the deployment, for as long as it takes to confirm from reports that no legitimate sender is failing. Going straight to enforce means finding out from a sender who could not reach you.

Wildcards

A wildcard matches exactly one label, at the left. *.olc.protection.outlook.com matches eur01.olc.protection.outlook.com and does not match a.b.olc.protection.outlook.com. Every MX host must match some entry; one that does not is not deliverable to under enforce.

Knowledge check

A policy lists mx: mail1.example.com with max_age 604800. You add mail2.example.com to your MX set today. When can it receive from an MTA-STS-enforcing sender?

Try it on a real domain

Free, no account, public DNS only.

Last reviewed