Free tool
MTA-STS generator
Enter your domain to fill in its MX hosts, then copy the MTA-STS record, the policy file, and an optional TLS-RPT record. Free, no signup.
Your MTA-STS setup
1. Publish the TXT record
Name (TXT record)
_mta-sts.shipmail.to
Value
v=STSv1; id=20261122140628
2. Host the policy file
Serve this file over HTTPS at the URL below, with a certificate valid for mta-sts.shipmail.to.
Policy URL
https://mta-sts.shipmail.to/.well-known/mta-sts.txt
Policy file (mta-sts.txt)
version: STSv1 mode: testing mx: mx1.shipmail.to max_age: 604800
Not sure which hosts receive your mail? Look them up with the free MX record lookup
What MTA-STS does
Mail servers encrypt SMTP only when both sides offer it, and an attacker on the network path can remove that offer so mail travels in plain text. MTA-STS lets your domain publish a policy that lists your MX hosts and requires senders to reach them over TLS with a valid certificate.
Gmail and Microsoft 365 read the policy before they deliver to you. In enforce mode they refuse to deliver to a host that is not listed or does not present a valid certificate.
Three things to publish
A TXT record at _mta-sts.yourdomain.com announces the policy and its id. The policy file itself is served over HTTPS at https://mta-sts.yourdomain.com/.well-known/mta-sts.txt, so the mta-sts subdomain needs a web server with a valid certificate for that name. A static site host is enough.
Change the id in the TXT record every time you change the policy file. Senders only fetch the file again when the id changes or max_age runs out. The generator uses the current time as the id, so a fresh page gives you a new one.
Start in testing mode
In testing mode senders deliver exactly as before and report any TLS failures. Add the TLS-RPT record so those reports reach you, read them for a week or two, then switch the policy file to enforce and update the id.
To retire MTA-STS, publish mode: none with a new id and leave it up for one max_age period before you delete the records, so senders drop the policy they cached.
What max_age should I use?
604800 seconds (one week) while testing. Once enforce mode works, many domains raise it to several weeks, up to the maximum of 31557600 seconds. Senders cache the policy that long, so a long max_age also delays your changes.
Can I host the policy file on my main website?
No. It must be served from the mta-sts subdomain of your domain, at /.well-known/mta-sts.txt, over HTTPS with a certificate valid for that hostname.
Do I need TLS-RPT?
It is optional, but without it you never learn when senders fail to reach you over TLS. Reports arrive daily as JSON files at the address in the _smtp._tls record.
Which MX hosts should the policy list?
Every host in your MX records, or a wildcard such as *.mail.example.net that covers them. In enforce mode, mail to a host missing from the policy is not delivered.
Email, newsletters and booking pages on your own domain, in one plan.
Get started for free