Free tool · no signup
MTA-STS and TLS-RPT generator
Make sure other mail servers encrypt every message they send to you. Get the policy file, the DNS record and the report record in one go, with a safe testing mode first.
By the Bug Circuit security team · Last updated
Your mail setup
- Add at least one MX host, exactly as it appears in your DNS MX records, for example aspmx.l.google.com.
How it works
What MTA-STS protects against
Email between servers uses opportunistic encryption: the sender asks for TLS, and if the receiver does not offer it, or an attacker on the network strips the offer, the message goes in plain text. MTA-STS (RFC 8461) closes that hole for mail sent to your domain. The sending server fetches your policy over https, and from then on it refuses to deliver to a server that cannot present a valid certificate for one of your listed MX hosts.
It protects incoming mail only. Mail you send is protected by the other side's policy, if they publish one.
The three pieces
First, a policy file at https://mta-sts.yourdomain.com/.well-known/mta-sts.txt. It lists your mode, your MX hosts and how long senders may cache it (max_age). The host needs a valid certificate and must answer with a 200 status and no redirect. Second, a TXT record at _mta-sts.yourdomain.com with v=STSv1 and an id. Senders re-fetch the policy only when the id changes, so change it whenever you edit the file. Third, a TLS-RPT record at _smtp._tls.yourdomain.com. Senders use it to email you daily reports about connection failures, and those reports are how you learn what enforce mode would break.
Roll it out safely
Start in testing mode with a short max_age. In testing, senders deliver even when the checks fail but still report the failures. After a week or two of clean reports, switch to enforce and raise max_age to a week or more. In enforce mode, a wrong MX name or an expired certificate means mail to you is held back or bounced, so keep your certificates renewing and update the policy before you change mail providers.
Worked examples
Google Workspace, testing mode
MX hosts aspmx.l.google.com and *.aspmx.l.google.com.
version: STSv1 mode: testing mx: aspmx.l.google.com mx: *.aspmx.l.google.com max_age: 86400
Check your own MX records and copy them exactly, because they depend on your plan and region.
Microsoft 365, enforced for a week
One wildcard MX host and a week-long cache.
version: STSv1 mode: enforce mx: *.mail.protection.outlook.com max_age: 604800
Microsoft 365 gives each domain an MX host ending in mail.protection.outlook.com, so the wildcard covers it. Move to enforce only after clean TLS-RPT reports.
The two DNS records
For example.com with an id from today's date and time.
_mta-sts.example.com TXT "v=STSv1; id=20261105090000" _smtp._tls.example.com TXT "v=TLSRPTv1; rua=mailto:tls-reports@example.com"
Change the id (for example to a new timestamp) every time the policy file changes.
Frequently asked questions
Do I need MTA-STS if I already have SPF, DKIM and DMARC?
What does the id in the DNS record do?
What is the difference between testing and enforce?
Do I need a web server just for this?
What is TLS-RPT?
What max_age should I use?
How do I switch it off?
Keep reading
See what attackers see, for free
Run the free passive check on your website. No login, no impact on your site, results in seconds.
Ready for the full manual audit? See pricing