Free tool
MTA-STS and TLS-RPT generator
Enter your domain and your receiving servers: the generator produces the MTA-STS policy file, the _mta-sts TXT record with a dated id and the TLS-RPT record, then explains where to host the file. Everything is calculated in your browser.
What to publish
1. Policy file
The result appears here once the form is complete.
2. _mta-sts TXT record
The result appears here once the form is complete.
3. TLS-RPT TXT record
Enter a report address to generate this record.
- Error: Enter your domain.
- Error: Add at least one receiving server.
- Warning: Without a report address, no TLS-RPT record is generated and you will see no failures.
Where to host the file
The policy file must answer over HTTPS at the exact address https://mta-sts.yourcompany.example/.well-known/mta-sts.txt.
- Add an A, AAAA or CNAME record for mta-sts.yourcompany.example to your DNS zone, pointing to a web host (static hosting, a free pages service or a small server).
- Have a certificate issued that is valid for mta-sts.yourcompany.example: most hosts do this by themselves.
- Put the policy file in the .well-known folder under the name mta-sts.txt, served as plain text, with a direct 200 response and no redirect.
- Publish the two TXT records in your DNS zone, then open the file's address in a browser to check.
After every change to the file, regenerate the id and update the _mta-sts record, otherwise senders keep the old policy.
What this generator does
MTA-STS requires the servers that write to you to encrypt the connection with a valid certificate, instead of accepting a plain connection that an intermediary could read or alter. It has three parts. The policy file, published on a website over HTTPS, lists your receiving servers and says whether the rule is only observed (testing) or enforced (enforce). A _mta-sts TXT record announces the policy and its id: when the id changes, senders read the file again. A TLS-RPT record says where to send reports about encryption failures. The generator builds all three as you fill in the form. Everything happens in your browser: nothing you type is sent to our server or stored.
How to choose your settings
Each mx line in the file must match the receiving servers in your MX record exactly, as they appear in their certificate; a name starting with a star and a dot covers every server in a subdomain. Start in testing mode: messages are delivered normally and you receive reports about failures. Switch to enforce after a few weeks without problems, because in that mode a sender refuses to deliver if encryption or the certificate fails. The max_age value says how long senders keep your policy: one week is a good start, one day is the recommended minimum, one year the maximum allowed. The id is the date and time of generation: it changes with every modification.
The most common mistakes
- Forgetting to change the id after editing the file: senders keep the old policy until max_age runs out.
- Serving the file through a redirect, or under a certificate that does not match mta-sts.yourcompany.example: senders ignore the policy.
- Switching to enforce while a receiving server presents an expired or self-signed certificate: legitimate mail is refused.
- Listing servers in the file that are not in your MX records, or forgetting one: mail to that server fails in enforce mode.
Where to host the file, step by step
The file is published on a small dedicated website, at https://mta-sts.yourcompany.example/.well-known/mta-sts.txt, that is, on the name mta-sts followed by your domain. First create a DNS record that sends mta-sts to a web host, of type A, AAAA or CNAME. Get a certificate valid for that name, which most hosts do automatically. Put the file in the .well-known folder under the name mta-sts.txt, served as plain text, without a redirect. Then publish the _mta-sts and _smtp._tls TXT records in your DNS zone. Finally, open the file's address in a browser: it must answer directly with the content.
Frequently asked questions
Do I really need a website for MTA-STS?
Yes: the standard requires the policy file to be published over HTTPS, on a dedicated name. It can be minimal static hosting, a page published by a free service or a small server: only the file matters, nobody visits this site.
What does testing mode mean?
In testing, senders check that the connection is encrypted and send you reports about failures, but still deliver the message. It is the starting mode. Enforce mode refuses delivery if the connection is not encrypted with a valid certificate.
Why is the id a date?
Senders only read the file again if the id has changed since last time. A date and time change for certain with every generation, and are easy to read. The format does not matter, as long as the value changes when the policy changes.
What is TLS-RPT for?
The _smtp._tls record gives the address that receives daily reports from senders: how many connections succeeded or failed, and why. Without it, you would switch to enforce without seeing anything coming.
Who checks MTA-STS?
The servers that send you mail, not visitors to your website. Large providers, including Google, check the policy before sending. Servers that do not support it simply ignore the record: publishing it breaks nothing.