Key facts
- MTA-STS is defined in RFC 8461; TLS reporting (TLS-RPT) in RFC 8460
- Needs a TXT record at _mta-sts.yourdomain and a policy file on HTTPS
- The policy lives at https://mta-sts.yourdomain/.well-known/mta-sts.txt
- Modes are testing, enforce or none; max_age can be up to 31,557,600 seconds
- TLS reports are requested with a TXT record at _smtp._tls.yourdomain
- Microsoft 365 and Google Workspace both support it, but neither hosts the policy file for you
- Set-up at £45 an hour + VAT
The problem MTA-STS solves
Email between servers is usually encrypted with STARTTLS, but by default it is opportunistic. If an attacker in the middle of the connection strips out the offer of encryption, or presents a fake certificate, most sending servers simply deliver the message in plain text anyway. MTA-STS, defined in RFC 8461, lets you publish a policy saying that mail to your domain must be delivered over TLS to named mail servers with a valid certificate. Senders that support it will refuse to deliver if those conditions are not met.
Microsoft's documentation for Exchange Online explains the effect clearly: if a sender that does not support MTA-STS sends to you, mail is still delivered as before. The only case where mail is not delivered is when both sides use MTA-STS and the check fails. That is why you start in testing mode.
The three parts of an MTA-STS set-up
- A TXT record at
_mta-sts.example.co.ukcontainingv=STSv1; id=20261111090000Z;. The id can be any short alphanumeric value; you change it every time you change the policy so senders fetch the new one. - A policy file served at exactly
https://mta-sts.example.co.uk/.well-known/mta-sts.txt. RFC 8461 says the certificate must be valid for that mta-sts host name, only an HTTP 200 response counts and redirects are not followed. - A DNS record for the mta-sts subdomain pointing at whatever web server hosts the file.
A policy for a domain on Microsoft 365 looks like this:
version: STSv1
mode: testing
mx: *.mail.protection.outlook.com
max_age: 604800
The mx lines must match your real MX records. Microsoft notes that the wildcard above is specific to Exchange Online; for other providers you list their exact MX host names. RFC 8461 sets the maximum max_age at 31,557,600 seconds, about a year.
TLS reporting: see what is failing
TLS reporting, from RFC 8460, asks sending servers to email you a daily summary of successful and failed TLS connections to your domain. You turn it on with a TXT record:
_smtp._tls.example.co.uk TXT "v=TLSRPTv1; rua=mailto:[email protected]"
Reports are JSON files covering a full UTC day. They show the policy the sender saw, how many sessions succeeded and failed, and failure types such as certificate expired, certificate host mismatch or STARTTLS not supported. Google's Workspace guide suggests adding the TLS reporting record first, so you can see problems while the policy is still in testing.
Reports can be noisy to read by hand, so we use a mailbox or parsing tool and summarise what matters for you.
Testing, then enforce
- testing: senders fetch your policy and send TLS reports, but still deliver if checks fail. Microsoft and Google both recommend starting here.
- enforce: senders that support MTA-STS refuse to deliver if TLS or the certificate check fails. Exchange Online, for example, returns errors such as 5.4.8 or 5.7.5 when a destination fails validation.
- none: tells senders to stop applying a previous policy, used when retiring MTA-STS.
We leave a new policy in testing for a few weeks, read the reports, then switch to enforce and update the id. If you later move email provider, the policy must be updated before the MX records change, or enforcing senders will refuse to deliver to the new servers. That step is part of our email migration checklist.
Microsoft 365, Google Workspace and hosted email
Exchange Online checks MTA-STS on outbound mail automatically, so your staff's messages already respect other domains' policies. For inbound protection, Microsoft says it cannot host the policy file for you, so you need a web host with a valid certificate for the mta-sts subdomain. Google Workspace has the same arrangement: the Admin console can check your configuration on the Security Health page, but the DNS records go at your domain host.
For hosted mailboxes, MTA-STS only makes sense if the mail server presents a valid certificate that matches its MX host name. We check that first.
How dijitul sets it up
We confirm your MX hosts and their certificates, publish the TLS reporting record, host the policy file on HTTPS with a certificate for the mta-sts subdomain, add the _mta-sts record in testing mode, review the reports and then move to enforce. The work is charged at £45 an hour + VAT. DNS changes are included if your domain is on dijihost hosting. Call 01623 650333 or email [email protected].
How it works and what it costs
Domains are priced live in the client portal. DNS management and 10 mailboxes are included with dijihost Complete Hosting at £1 a day + VAT. On their own, DNS and email set-up is £45 an hour + VAT or a fixed quote.
Tell us what you have
Your domains, who they are registered with, where your DNS and email live today, and what you want to change.
Plan the change
We list every DNS record and mailbox first, so nothing is forgotten, and agree a time to switch.
Make the switch
Transfers, nameserver changes, DNS records and mailbox moves, done carefully with low TTLs and a rollback plan.
Check it works
We test the website, email delivery, SPF, DKIM and DMARC from the outside before calling it done.
Look after it
Renewals, records and email stay looked after, and you can call a person when something changes.
Frequently asked questions
What does MTA-STS actually protect against?
It stops a sending server falling back to unencrypted delivery or accepting a fake certificate when it delivers mail to you. That protects against downgrade and man-in-the-middle attacks on mail in transit between servers. It does not encrypt mail stored in mailboxes.
Can MTA-STS stop my email arriving?
Only in enforce mode, and only from senders that support it, when TLS or the certificate check fails. That is why dijitul starts in testing mode with TLS reports turned on, and only switches to enforce when the reports are clean.
Does Microsoft 365 host the MTA-STS policy for me?
No. Microsoft's documentation says Exchange Online cannot host the policy file. You need an HTTPS web host for mta-sts.yourdomain with a valid certificate. dijitul can host it for you.
What is TLS-RPT?
TLS reporting, defined in RFC 8460. You publish a TXT record at _smtp._tls.yourdomain with an address, and sending servers that support it email you a daily JSON report of successful and failed encrypted connections to your mail servers.
Do I need to change MTA-STS when I move email provider?
Yes. The policy lists your allowed MX hosts. Update the policy and its id before you change the MX records, or senders enforcing the old policy will refuse to deliver to the new servers.
How much does MTA-STS setup cost?
dijitul charges £45 an hour + VAT. A typical single domain on Microsoft 365 or Google Workspace is a short job, with a follow-up a few weeks later to review reports and switch to enforce.
Related
Get domains, DNS and email sorted
Set up properly, records checked, and real people to call. DNS and email are included with dijihost hosting.