Skip to content
AdminKit
Live Updated

MTA-STS policy generator: build the policy file and TXT record in your browser

How does this check work, and what does the result tell you?

AdminKit's MTA-STS policy generator builds the exact mta-sts.txt policy file body and the matching _mta-sts TXT record from your chosen mode, MX host patterns and max_age — entirely in your browser, with nothing sent to any server. You still have to host the policy file and publish the TXT record yourself, then confirm both with AdminKit's live MTA-STS check.

Part of the Email authentication cluster — more tools, guides and terms on email authentication.

What senders should do with mail they can't deliver over TLS to a listed MX host.

How long senders may cache this policy before re-fetching it.

One per line or comma-separated, e.g. mail.example.com or *.example.net — match your domain's real MX records.

1-32 letters/digits; change it whenever the policy changes so senders know to re-fetch it.

  • mx must list at least one MX host pattern when mode is enforce or testing.

What the result means

This is the policy file and TXT record text built from the values you entered — it says nothing about what your domain currently publishes or hosts. To see what is actually live today, run AdminKit's MTA-STS check.

Next step

Host the policy file above at https://mta-sts.<your domain>/.well-known/mta-sts.txt and publish the TXT record at _mta-sts.<your domain>, then confirm both with the live MTA-STS check once DNS has propagated.

Keep this result

Copy a link to this check so you can share it or run it again later. Want a heads-up if something changes? That's early access, not a live feature yet — tell us and we'll set it up by hand.

How it works and limits

Fill in a mode, your MX host patterns, a max_age and a policy id below, and this tool assembles both the mta-sts.txt policy file body and the _mta-sts.<your domain> TXT record as you type, entirely in your browser — nothing you enter is sent to AdminKit or anywhere else. Once you are happy with the result, host the policy file and publish the TXT record yourself, then confirm both took effect with AdminKit’s live MTA-STS check, which queries DNS and fetches the policy file for real and reports back what it actually found.

What do the policy file and the TXT record each actually do?

RFC 8461 splits MTA-STS into two pieces that both have to be published together: the _mta-sts.<domain> TXT record is a short pointer, published in DNS, that tells a sending server a policy exists and gives it a version id to detect changes by; the policy file itself, hosted over HTTPS at mta-sts.<domain>/.well-known/mta-sts.txt, is where the actual rules live — the mode, the mx hosts the policy covers, and the max_age senders should cache it for. A sender that finds the TXT record but can’t fetch a valid policy file treats that as a broken deployment, which is exactly why this tool builds both pieces together instead of just one.

The fields this tool builds from

  • mode — enforce (senders must defer or reject mail they can’t deliver over TLS to a listed MX host), testing (senders only report what would have happened, without blocking anything) or none (the domain declares no MTA-STS support at all).
  • mx — one or more MX host patterns the policy covers, such as mail.example.com or a wildcard like *.example.net; only meaningful (and only included in the output) for enforce and testing.
  • max_age — how many seconds a sender may cache the policy before re-fetching it, as a whole number up to RFC 8461 §3.2’s own one-year (31557600) recommendation.
  • id — a 1-32 character alphanumeric string the TXT record carries so senders can tell when the policy has changed; this tool suggests a UTC timestamp by default, matching the worked example in RFC 8461’s canonical IETF Datatracker record.

Limits

  • This tool only builds the policy file body and the TXT record text. It never queries DNS, never fetches a URL and never publishes anything — you still have to host the file and add the record yourself, then confirm both with a live check.
  • It validates the values you enter (mode keywords, MX host syntax, numeric ranges, id format) but has no way to know whether the MX hosts you list actually match your domain’s real MX records.

For the full rollout path — start in testing, add TLS-RPT with AdminKit’s TLS-RPT check for visibility into delivery reports the policy itself won’t tell you about, then move to enforce once reports confirm the MX list is accurate — see how to publish and test MTA-STS. Once your policy is live, confirm it with AdminKit’s MTA-STS check, and check your domain’s DMARC policy next, since the two protect different parts of the same mail flow — MTA-STS protects incoming transport, DMARC protects the visible From: domain.

Frequently asked questions

Does this tool send anything to AdminKit's servers?

No — every field you fill in is read directly by your browser, and the policy file body and TXT record string are built there with plain JavaScript. Nothing you type is sent to AdminKit or anywhere else. That also means it cannot check what your domain currently publishes or hosts; for that, use AdminKit's live MTA-STS check, which does query DNS and fetch the policy file over HTTPS.

I built a policy here — do I still need to do anything else?

Yes: this tool only builds the two pieces of text. You still have to publish the TXT record yourself at _mta-sts.<your domain> in your DNS provider's control panel, host the policy file at https://mta-sts.<your domain>/.well-known/mta-sts.txt over HTTPS, then confirm both actually took effect with AdminKit's MTA-STS check, which queries DNS and fetches the policy file for real.

Why does mode=none leave out the mx lines?

RFC 8461 §3.2 only defines mx as meaningful for policies that require TLS to specific MX hosts — mode=none means the domain explicitly declares no MTA-STS support, so there is nothing for an mx list to constrain. This tool omits mx entirely at mode=none even if you had entered hosts earlier, to keep the generated file honest about what mode=none actually means.

What should I put in the id field, and does it matter what format it is?

RFC 8461 §3.1 only requires id to be 1-32 letters or digits that change whenever the policy's content changes, so senders caching the old policy know to re-fetch it — the RFC's own worked examples use a UTC timestamp, which is what this tool suggests by default, but any unique alphanumeric string works just as well.

How long should I set max_age while I'm still rolling this out?

A short max_age (for example 86400, one day) during testing mode limits how long a sender would keep enforcing a mistake if your MX list turns out to be wrong, while a longer value (RFC 8461 §3.2's own example uses 604800, one week, and the ceiling this tool enforces is 31557600, one year) is more appropriate once you've confirmed the policy with AdminKit's MTA-STS check and moved to enforce.