What MTA-STS does
Email between servers is often encrypted, but not always. Without MTA-STS an attacker can force delivery over an unencrypted connection. MTA-STS says that email to the domain must only be delivered encrypted to the right servers.
Two parts that must match
- A TXT record on _mta-sts in front of the domain, with an id that changes every time the policy changes.
- A policy file on mta-sts in front of the domain, under /.well-known/mta-sts.txt, with a valid certificate.
Testing or enforce
Start in testing. Failures are then reported, but email is delivered as before. When the TLS reports are clean, move to enforce.
Example policy file
- version: STSv1
- mode: testing
- mx: company-com.mail.protection.outlook.com
- max_age: 604800
Each mx line must cover one of the MX records of the domain. max_age is in seconds and says how long senders remember the policy. One week is common at the start.