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
| Field | Values | Meaning |
|---|---|---|
version | STSv1 | The only version. |
mode | enforce, testing, none | What a sender does when the policy is not satisfied. |
mx | A hostname, or a wildcard on the leftmost label | Repeatable. The complete list of permitted MX hosts. |
max_age | Seconds, up to 31557600 | How long a sender caches this policy. |
Two live policies
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
version: STSv1 mode: enforce mx: *.olc.protection.outlook.com max_age: 604800
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
| Mode | A sender that cannot satisfy the policy… |
|---|---|
enforce | Does not deliver. This is the point of the mechanism. |
testing | Delivers anyway, and reports the failure via TLS-RPT. |
none | Ignores 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.