mailampel

← All articles

Setting up MTA-STS: enforced encryption for incoming email

MTA-STS forces sending servers to deliver your email encrypted only, and only to your real mail servers. Setup with policy file, DNS record and TLS-RPT.

6 min read · Updated 2 September 2026

Between mail servers, encryption is normally only offered, not required — an attacker on the network path can negotiate it away and read along, or redirect emails to a wrong server. MTA-STS (Mail Transfer Agent Strict Transport Security) closes exactly this gap: your domain publishes a binding statement, "deliver to me only over TLS and only to these mail servers". Google, Microsoft and the other big players honour it.

The three building blocks

MTA-STS consists of a policy file at a fixed address, a DNS record that points to it, and — sensibly — TLS-RPT for reports. The policy file ALWAYS lives at the same address: https://mta-sts.your-domain.at/.well-known/mta-sts.txt — which requires a small website on the subdomain mta-sts with a valid certificate.

DNS record of type TXT:
Name / host
_mta-sts.beispiel.at
Value
v=STSv1; id=2026090201
The id is a freely chosen stamp. IMPORTANT: every change to the policy file must also bump the id — otherwise senders keep using the old version they have cached.

The policy file itself is plain text and states the mode, the permitted mail servers and the caching period:

DNS record of type File:
Name / host
https://mta-sts.beispiel.at/.well-known/mta-sts.txt
Value
version: STSv1 mode: testing mx: *.protection.outlook.com max_age: 86400
The mx lines must match your real MX records (patterns with * are allowed). The example here: Microsoft 365.

First testing, then enforce

In testing mode nothing is rejected yet — senders only report problems (via TLS-RPT). Only enforce makes the rule binding. The safe route: start with testing and a small max_age (e.g. one day), watch the reports for a few weeks, then switch the file to enforce, raise max_age to one week (604800) — and bump the id in the TXT record in the same step.

TLS-RPT: the reports to go with it

DNS record of type TXT:
Name / host
_smtp._tls.beispiel.at
Value
v=TLSRPTv1; rua=mailto:dmarc@beispiel.at
Large senders will then send daily reports on successful and failed TLS deliveries — your early-warning system for the move to enforce.

Frequently asked questions

Do I need MTA-STS if I use Microsoft 365 or Google?

Your mailbox provider supplies the server side (TLS, valid certificates) — but the statement that your domain may only be delivered to over encrypted connections is published by the domain owner. Without your record, delivery to you remains open to a downgrade.

What is the difference to DANE?

DANE achieves the same goal via DNSSEC-secured TLSA records and is cryptographically stricter — but many large senders do not evaluate it, and it requires DNSSEC. MTA-STS works without DNSSEC and is actively used by Google and Microsoft; both can coexist.

Does MTA-STS count towards the deliverability of my OUTGOING email?

Only indirectly. MTA-STS protects delivery TO you. For outgoing mail, SPF, DKIM and DMARC are what count — MTA-STS is still part of the clean domain hygiene that distinguishes reputable senders.