MTA-STS and TLS-RPT Policy Builder

Write a correct mta-sts.txt, the _mta-sts and _smtp._tls records and hosting config, check what you already publish, and read the daily TLS reports.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Enter your domain

    Type the domain and choose a mode and max_age.

  2. 2
    List MX hosts

    Add each MX host or wildcard and test real host names against them.

  3. 3
    Add report addresses

    Enter one or more mailto or https addresses for TLS-RPT.

  4. 4
    Publish

    Copy the policy file, the DNS records and the hosting snippet you need.

  5. 5
    Check

    Paste your live policy and TXT records into the Check tab.

  6. 6
    Read reports

    Open TLS-RPT JSON files and fix every failure before switching to enforce.

About this tool

Mail servers talk to each other over SMTP, and encryption between them is opportunistic: if a receiving server offers STARTTLS the sender uses it, but an attacker on the network can strip that offer and the mail goes out in clear text, or present any certificate at all. MTA-STS fixes this for inbound mail. You publish a short policy file over https that lists your MX hosts and says enforce, and compliant senders such as Gmail and Outlook then refuse to deliver unless they get a valid certificate for one of those hosts. TLS-RPT is the companion standard: a DNS record asks senders to email you a daily JSON report of successful and failed TLS sessions. This builder writes all the pieces: the policy file with correct CRLF line endings, the _mta-sts TXT record with a policy ID, the _smtp._tls reporting record, and server snippets for hosting the file. It also validates an existing policy and records, tests host names against your MX patterns and reads the JSON reports you receive.

Building the policy

Choose testing, enforce or none, a max_age and the MX host patterns. A pattern can be an exact host such as mail.example.com or a wildcard such as *.example.net, which matches exactly one extra label. The pattern tester tells you whether a host name would be accepted, which matters most when you use a hosted mail provider with many MX names. The policy ID in the DNS record must change every time the file changes, so the builder offers a fresh timestamp ID with one click and refreshes it automatically when you change the mode or max age.

Hosting the file

The policy must be served at https://mta-sts.yourdomain/.well-known/mta-sts.txt with a certificate valid for that exact host name and without redirects. The builder shows an Nginx server block, a Cloudflare Worker and notes for static hosts. A missing certificate on the mta-sts host is the most common setup mistake and shows up in reports as sts-webpki-invalid.

Reading TLS-RPT reports

Open the .json.gz or .json files that arrive from reporters. The tool totals successful and failed sessions, lists failures by result type with a plain explanation, such as certificate-host-mismatch or starttls-not-supported, and shows each sending IP, MX host and count. This is how you know it is safe to switch from testing to enforce.

Rollout plan and limits

A built-in plan walks from TLS-RPT first, through testing mode for two to four weeks, to enforce, and covers MX changes and withdrawal. The tool does not fetch your live policy or query DNS, because browsers cannot make DNS queries; paste what you publish to check it. It does not test whether your MX servers actually offer valid TLS. MTA-STS protects mail sent to you, not mail you send.

Worked example

For example.com with MX hosts mail.example.com and mail2.example.com, the builder produces a policy with version STSv1, mode testing, two mx lines and max_age 604800, plus _mta-sts.example.com TXT v=STSv1; id=20261103T090000 and _smtp._tls.example.com TXT v=TLSRPTv1; rua=mailto:[email protected]. After two weeks, 14 Google reports show 12,840 successful sessions and 37 failures, all certificate-host-mismatch from mail2, whose certificate only named mail.example.com. Once mail2 gets a correct certificate, a week of reports shows zero failures, and the admin switches to enforce with max_age 2592000 and a new ID.

Quick facts

Frequently asked questions

What is the difference between testing and enforce?

In testing mode senders still deliver over insecure or unverified connections but report problems through TLS-RPT. In enforce mode they refuse to deliver unless TLS succeeds with a valid certificate for a listed MX.

Why must the policy ID change?

Senders cache the policy for max_age seconds and only fetch it again when the ID in DNS changes. If you edit the file but keep the ID, senders keep using the old policy.

How long should max_age be?

Use a day or a week while testing. In enforce mode a few weeks to six months is common; longer values protect better against an attacker who blocks the policy fetch, up to one year.

Does MTA-STS need DNSSEC?

No. It relies on the web certificate of the mta-sts host instead, which is why it is easier to deploy than DANE. If you have DNSSEC, DANE and MTA-STS can be used together.

Who sends TLS-RPT reports?

Google, Microsoft and several other large providers send daily reports to the rua address. Small senders often do not, so reports show most but not all traffic.

How do I turn MTA-STS off safely?

Publish mode none with a new ID and keep the file online for at least one max_age period, so senders replace their cached enforce policy before you remove anything.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages