List your mail servers and get the policy file, the record, and the order to publish them in without losing mail.
MTA-STS (RFC 8461) stops a sending server from quietly falling back to an unencrypted connection. Unlike SPF or DMARC it is not one DNS record: it is a policy file, served over HTTPS from a fixed hostname, plus a TXT record that tells senders to go and read it.
The hostname is not negotiable. The policy must be at
https://mta-sts.yourdomain/.well-known/mta-sts.txt with a certificate
valid for mta-sts.yourdomain. It cannot be served from the main
domain, which is why publishing MTA-STS usually means adding a name to a
certificate rather than just editing DNS.
The id below is generated fresh each time. Senders cache the policy
against that id, so editing the file and leaving the id alone means they keep the
copy they already have until max_age runs out. Changing it is the
step people forget.
Serve the policy file first and fetch it yourself over HTTPS to confirm it works. Publish the TXT record last. A record whose policy cannot be fetched is treated as a failure by senders that cache MTA-STS, which is worse than publishing nothing.
Testing. It protects nothing, but it produces the TLS reports that tell you whether enforce would break delivery. In enforce a sender that cannot match your MX against the policy refuses to deliver rather than falling back, so a missing mx line stops mail rather than degrading it.
The policy stops matching and, in enforce mode, mail to the new server is refused. Update the policy and the id whenever MX changes, and prefer a slightly shorter max_age while you are still making changes.
Not technically, but testing mode is pointless without it: the reports are the only way to see the failures that testing mode exists to surface.
Because that is the field people forget. Senders cache the policy against the id, so an edited file with the old id is ignored until max_age expires. Generating a fresh one each time makes the mistake hard to make.
This check reads what is public. These are the engagements that go further, and what each one covers.