1. Home
  2. Developer tools
  3. MTA-STS Generator

MTA-STS Generator

MTA-STS tells other mail servers to use verified TLS when sending to you. Enter your MX hosts and mode and get the policy file and DNS records, or check a domain.

Free, no sign-up. Runs in your browser; see “Private by design” for the one online step.

How to use MTA-STS Generator

  1. Enter your domain, MX hosts and mode.
  2. Copy the policy file and the DNS records.
  3. Publish them and switch to enforce when reports look good.

Features

  • Policy file in the RFC 8461 format
  • TXT record with a fresh id
  • TLS-RPT record for reports
  • Testing, enforce and none modes
  • Checker for existing records
  • Validates MX patterns and max_age

Supported formats

Input

  • Domain, MX hosts and mode

You get

  • Policy file
  • DNS records

Private by design

Generating the policy and records is fully local. If you press Check a domain, the domain names (the _mta-sts and _smtp._tls TXT names) are sent over HTTPS to the resolver you choose, Cloudflare (cloudflare-dns.com) or Google (dns.google). The policy file itself is not fetched, because browsers cannot read it from other sites. How local processing works

Good to know

  • The policy file must be served over HTTPS at mta-sts.your-domain by you; the page cannot host it.
  • Browsers cannot fetch another site’s policy, so the checker reads DNS records only.

Guide

MTA-STS and TLS reporting: publishing an encrypted-mail policy

Email between servers is encrypted only if both sides ask for it, and a sender that fails to negotiate TLS normally falls back to plain text. An attacker in the path can exploit that by stripping the encryption offer. MTA-STS lets a receiving domain announce that senders must use verified TLS to specific mail servers. The page generates the policy and the DNS records for it, and checks what a domain already publishes.

The three parts

First, a policy file, plain text served over HTTPS at https://mta-sts.example.com/.well-known/mta-sts.txt, from a host with a valid certificate. Second, a TXT record at _mta-sts.example.com such as v=STSv1; id=20261102183328, whose id tells senders whether their cached policy is out of date. Third, optionally, a TLS-RPT record at _smtp._tls.example.com, for example v=TLSRPTv1; rua=mailto:[email protected], which asks senders to send daily reports of TLS failures. Both standards are published as RFCs: 8461 for MTA-STS and 8460 for TLS-RPT.

The policy file

It has four kinds of line. version: STSv1. mode: set to testing, enforce or none. One or more mx: lines naming the mail servers that are valid for the domain, where a leading wildcard such as *.example.com is permitted. And max_age: in seconds. The file must be served with lines ending in CRLF, which the page notes. In testing mode senders apply the policy for reporting but still deliver when it fails; in enforce they refuse; none switches the policy off cleanly.

Using the page

On the first tab, enter the mail domain, choose the mode, set max_age, list your MX host names one per line and optionally a reporting address. The page shows the policy URL, the exact file text with a copy and download button, and the DNS records, with an id built from the current time. Whenever you change the policy file, change the id too; senders only fetch a new copy when the id in DNS changes. The second tab, “Check a domain”, reads what a domain publishes in DNS and flags problems in the id, version and reporting record.

A worked example

For example.com with the MX host mail.example.com, mode testing and the default lifetime, the page produces the file version: STSv1, mode: testing, mx: mail.example.com, max_age: 86400. The records are _mta-sts.example.com. IN TXT "v=STSv1; id=…", an address record for mta-sts.example.com pointing to the web server that serves the file, and _smtp._tls.example.com. IN TXT "v=TLSRPTv1; rua=mailto:[email protected]". The id is a timestamp, so it is different each time you generate.

Limits

The page writes text; you still have to host the file over HTTPS with a valid certificate on the mta-sts host. Browsers cannot read another site’s policy file because of cross-origin rules, so the checker reads the DNS records only and cannot confirm that the file is reachable or correct. Start in testing mode, read the reports for a few weeks, and only then switch to enforce. Compare with the Email Spoofing Test, which rates the presence of these records.

Checked against the current version of the MTA-STS Generator on .

Frequently asked questions

What is a safe max_age?

Start small while testing, such as 86400 (one day), then lengthen it once the policy is stable. The maximum RFC 8461 allows is 31,557,600 seconds, about a year. A long lifetime protects senders who cannot reach the policy later, but also delays corrections.

What if my certificate expires while the policy is in enforce mode?

Senders that have cached the policy will refuse to deliver to a server whose certificate fails validation, so mail queues up or bounces. Automate certificate renewal and monitor the TLS reports before choosing enforce.

Why start in testing mode?

In testing mode senders report problems but still deliver. Enforce mode makes them refuse delivery if your certificate does not match, so a mistake can lose mail.

Why change the id when the policy changes?

Senders cache the policy and only refetch it when the id in DNS changes.

Is anything sent over the internet?

Generating the policy and records is fully local. If you press Check a domain, the domain names (the _mta-sts and _smtp._tls TXT names) are sent over HTTPS to the resolver you choose, Cloudflare (cloudflare-dns.com) or Google (dns.google). The policy file itself is not fetched, because browsers cannot read it from other sites.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.