# MTA-STS Checker

Validate MTA-STS (RFC 8461) for a domain: the _mta-sts TXT record (version, id, a CNAME to another domain is allowed), the policy file fetched over HTTPS from mta-sts.<domain> (status, type, size, version, mode, mx patterns, max_age), and the match between the policy's mx lines and the domain's MX hosts, wildcards included. Returns a verdict (enforcing, testing, broken, none), the lines with notes, which MX hosts match and by what, patterns that match nothing, whether TLS-RPT is published and the steps to reach enforce. Mail server certificate checks need a mail server connection and are reported as not checked yet. Public domains only.

**Not for:** Generating a policy (not available yet) or checking the SMTP server itself.

- Tool id: `mta-sts-check`
- Category: email
- Execution: network
- MCP tool `mta_sts_check` at https://lookupowl.com/mcp
- REST `GET https://lookupowl.com/api/v1/tools/mta-sts-check` (or POST a JSON body)
- OpenAPI: https://lookupowl.com/api/openapi.json

## Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `domain` | string | yes |  | The domain people send mail to, such as example.com. An email address works too: only the part after the @ is used, and it is not stored. min length 1, max length 320 |
| `checkMxCertificates` | boolean | no | `true` | Check each mail server's certificate name against the policy. Needs a connection to port 25 on each mail server, which this version does not make: the answer says "not checked yet". |

## Output

Results are wrapped in an envelope: `tool`, `version`, `requestId`, `data`, `summary`, `meta` (cache status, timing), `permalink`. `data` has these fields:

| Field | Type | Description |
|---|---|---|
| `domain` | string |  |
| `asOf` | string |  |
| `verdict` | "enforcing" \| "testing" \| "broken" \| "none" | enforcing or testing: a working policy in that mode. broken: a record or file senders will ignore. none: no MTA-STS (or a policy in mode none). |
| `txt` | object |  |
| `policy` | object |  |
| `mxMatch` | object[] |  |
| `extraPatterns` | string[] | Policy mx patterns that match none of the domain's MX hosts. |
| `noMail` | boolean | The domain publishes a null MX (0 .): it does not receive mail. |
| `certificates` | "not-checked-yet" \| "skipped" | Mail server certificates are not checked in this version (they need a connection to port 25). skipped: the caller turned the check off. |
| `tlsRpt` | object |  |
| `readiness` | object |  |
| `notChecked` | "mx" \| "tls-rpt"[] | Parts we could not read because DNS did not answer in time. |
| `issues` | any[] |  |

## Examples

### Enforcing: gmail.com

```json
{"domain":"gmail.com","checkMxCertificates":true}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/mta-sts-check?checkMxCertificates=true&domain=gmail.com'
```

Web page: https://lookupowl.com/mta-sts-checker?q=gmail.com

### Testing mode: fastmail.com

```json
{"domain":"fastmail.com","checkMxCertificates":true}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/mta-sts-check?checkMxCertificates=true&domain=fastmail.com'
```

Web page: https://lookupowl.com/mta-sts-checker?q=fastmail.com

### Not set up: lookupowl.com

```json
{"domain":"lookupowl.com","checkMxCertificates":true}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/mta-sts-check?checkMxCertificates=true&domain=lookupowl.com'
```

Web page: https://lookupowl.com/mta-sts-checker?q=lookupowl.com

## Web pages

- https://lookupowl.com/mta-sts-checker

## Limits and caching

- Cost: 6 units for a live lookup, 1 unit for a cached one. Budgets are per network and published in the `RateLimit` response headers.
- Cache: results are kept for 300 s. Add `fresh=true` (MCP argument or query parameter) to look again; it costs 3 units per unit and is limited to 10 per hour.
- Timeout: 15 s.

## Related tools

- [TLS-RPT Checker](https://lookupowl.com/tools/tls-rpt-check.md): Check a domain's TLS-RPT record: where mail servers send reports about failed encrypted deliveries, and whether those addresses work.
- [Email Health Checker and Spoofing Test](https://lookupowl.com/tools/email-health.md): Check a domain's whole mail setup in one report: mail servers, SPF, DKIM, DMARC, BIMI, MTA-STS, TLS-RPT and blocklists, with the fixes to make first.
- [SPF Record Checker](https://lookupowl.com/tools/spf-checker.md): Check a domain's SPF record, count its DNS lookups against the limit of 10 and find errors.
- [DMARC Record Checker](https://lookupowl.com/tools/dmarc-checker.md): Look up and validate a domain's DMARC policy, report addresses and alignment settings.
- [DKIM Record Checker](https://lookupowl.com/tools/dkim-checker.md): Find and check a domain's DKIM public keys, even when you do not know the selector.
- [SSL Certificate Checker](https://lookupowl.com/tools/ssl-checker.md): Check a site's SSL/TLS certificate: days until it expires, whether it is trusted, matches the host and has a complete chain.

## Guide: MTA-STS checker

Check whether a domain tells other mail servers to insist on encrypted delivery, and whether its policy file is right.

### What MTA-STS does

Email between servers is encrypted when both sides agree to it, and a network attacker can make them disagree. Server A asks for encryption, the attacker strips the request, and the message travels in the clear. MTA-STS (RFC 8461) closes that gap. A domain publishes a promise: mail to me must use TLS, and it must go to these servers.

The promise has two halves that must agree. A short DNS record at `_mta-sts.example.com` says a policy exists and gives it an id. The policy itself is a small text file served over HTTPS at `https://mta-sts.example.com/.well-known/mta-sts.txt`. Most people have never seen that file, so this page shows it, line by line.

MTA-STS only protects mail from senders that support it. The big mailbox providers do, so it covers a large share of the mail you receive, but it is not a promise about every sender.

### What this checker reads

Type a domain, or an email address and we use only the part after the @. We never store the address. Then we do these things, in this order.

1. Read the TXT record at `_mta-sts.<domain>`. It must be one record that starts with `v=STSv1` and has an `id` of up to 32 letters and digits. A CNAME to another domain is allowed, and we say where it leads.
2. Fetch the policy file from `mta-sts.<domain>` over HTTPS. RFC 8461 forbids following a redirect, so a redirect counts as a failure. The file must answer 200, be served as `text/plain`, stay under 64 KB and come with a certificate that is valid for that name.
3. Read the file line by line: `version`, `mode`, one or more `mx` lines and `max_age`. Each line gets a mark and one plain sentence, and a line we cannot read is shown exactly as it is.
4. Look up the domain's MX records and match each mail server against the `mx` patterns, wildcards included. We show which line matched each server, and which patterns match nothing.
5. Look for a TLS reporting record, because without reports you will not hear about delivery problems when you move to enforce.

### Testing mode and enforce mode

The `mode` line has three values. In `none` the policy is switched off. In `testing`, senders report problems but still deliver the message, so a mistake costs you nothing but a report. In `enforce`, a sender that cannot reach a listed server over valid TLS holds the message back or sends it back.

Start in testing. When the report shows no failures for a week or two, change the mode to `enforce` and change the `id` in DNS so senders fetch the new file. When a domain is in testing mode, this page shows the steps left before you can move on.

> **Always change the id** Senders keep your policy for `max_age` seconds and only look for a new one when the `id` changes. If you edit the file and leave the id alone, senders that already cached the old policy keep using it.

### The rules a policy file has to follow

| Line | Rule | Example |
|---|---|---|
| `version` | Must be `STSv1`. It is the only version. | `version: STSv1` |
| `mode` | One of `none`, `testing` or `enforce`. | `mode: testing` |
| `mx` | A mail server name, or `*.` and a name for every server one level below it. Add one line per pattern. | `mx: *.mail.example.com` |
| `max_age` | How long senders keep the policy, in seconds, up to 31557600 (about a year). One day or more is usual. | `max_age: 86400` |

A wildcard stands for exactly one label. `*.example.com` matches `mx1.example.com` but not `a.mx1.example.com` and not `example.com` itself. Names are compared without regard to upper and lower case.

### Problems we find most often

- The record exists but `mta-sts.<domain>` does not resolve, or answers 404. Senders that cannot fetch the policy ignore MTA-STS, so nothing is blocked, but the protection is not there.
- A mail server in your MX records matches no `mx` line. In enforce mode senders refuse to deliver to it, so this is the most serious row on the page.
- The file redirects to another address, usually from a hosting service or a www prefix. Serve it directly at the fixed address.
- The file is served as `text/html`, often by a static site host. Senders may ignore it.
- More than one MTA-STS record at `_mta-sts`. Senders then treat the domain as having no policy at all.
- A policy in enforce mode and no TLS-RPT record. You would fail silently, because nothing tells you about the rejected mail. Use the [TLS-RPT checker](https://lookupowl.com/tls-rpt-checker) next.

### What this checker cannot see yet

A full MTA-STS check also connects to each mail server on port 25 and looks at its certificate: does it start TLS, is the name on the certificate one of your `mx` patterns, has it expired. We do not make that connection yet, so the certificate cells read "Not checked yet". That is not a fail. Before you move to enforce, check each server yourself, for example with the [SSL checker](https://lookupowl.com/ssl-checker), which can test STARTTLS on port 25.

Nobody can see from outside whether a sender fetched your policy or used it. Only your own reports can tell you that. For the other parts of mail trust, see the [SPF checker](https://lookupowl.com/spf-record-checker), the [DMARC checker](https://lookupowl.com/dmarc-checker) and the [DKIM checker](https://lookupowl.com/dkim-checker).

### Frequently asked questions

**What is the difference between testing and enforce?**

In testing mode senders report problems but still deliver the message. In enforce mode they refuse to deliver when TLS fails or the mail server is not on your list. Run in testing first, watch the reports, then switch.

**Why does the record have an id?**

The id changes whenever the policy file changes. Senders cache the policy for max_age seconds and only fetch it again when they see a different id. An id made from the date and time, such as 20261115T000000, is easy to keep fresh.

**Do I need TLS-RPT as well?**

You can run MTA-STS without it, but you should not. TLS-RPT is how senders tell you that a delivery failed. Without it, enforce mode fails silently. Check the record with the [TLS-RPT checker](https://lookupowl.com/tls-rpt-checker).

**What does a wildcard in an mx line match?**

One label, and only at the front. *.example.com matches mail.example.com. It does not match example.com, and it does not match a.mail.example.com. If your servers sit at different depths, add one line for each pattern.

**Why must the policy file not redirect?**

RFC 8461 says senders must not follow redirects when they fetch the policy. A redirect would give whoever controls the target a way to rewrite your policy. Serve the file straight from mta-sts.<your domain>.

**Does MTA-STS replace DANE?**

No. Both protect against downgrade attacks, in different ways. DANE needs DNSSEC and publishes certificate facts in DNS. MTA-STS needs a web server and a normal certificate. Some domains run both. We do not check DANE yet.

**Does this checker store the email address I type?**

No. If you type an address, only the part after the @ is used. It is cut before the lookup, it is not stored, and the result address carries only the domain.
