MTA-STS Not Set Up
DownBad’s Hardening checklist found no MTA-STS record on one or more of your domains. It’s an optional extra that protects mail sent to you, and this page helps you decide whether you want it, set it up, or dismiss the item.
What you’re seeing
Section titled “What you’re seeing”On Now, while no incident is open, the Hardening checklist lists MTA-STS under COULD, with a pill for each domain DownBad found without an MTA-STS record.
Your domain is the name your website and email use, such as example.com.
DNS (the Domain Name System) is the internet’s directory: it turns names
into addresses, and it holds other facts about each domain in records. A
TXT record is a DNS record that holds a line of text.
MTA-STS (Mail Transfer Agent Strict Transport Security, defined in RFC 8461) is for mail sent to your domain. It tells the mail servers (the computers that deliver email) of anyone writing to you that they must deliver over an encrypted connection (one that others on the network can’t read), to a server whose certificate proves it is one of your mail servers. A certificate is the file a server uses to prove its name. MTA-STS has two parts:
- a TXT record at
_mta-sts.example.com, beginningv=STSv1, and - a policy file (a short text file listing your mail servers) published on
the website
https://mta-sts.example.com/.well-known/mta-sts.txt.
DownBad looked for the TXT record, and found none. It checks this only on a domain that has an MX record (a DNS record naming the mail servers that accept the domain’s email). It doesn’t fetch the policy file, so a domain with the record and no policy file counts as done. Step 2 of Check it yourself checks the file too.
Why DownBad ranks it COULD. Without MTA-STS, a sending server that can’t set up an encrypted connection to your mail server may deliver over an unencrypted one instead, and someone able to interfere with the connection can force that. MTA-STS closes that gap, but it needs a website for the policy file and only helps a domain that receives mail. If nobody sends email to addresses at this domain, it does nothing.
Is it you or us?
Section titled “Is it you or us?”The checklist shows what DownBad’s last lookup of the domain found. It can miss a record that is there, for one of these reasons:
- The record was added after DownBad last looked. checked, beside the checklist, says when that was. Follow Confirm DownBad sees the fix to look again.
- The record is on the wrong name. It belongs on
_mta-sts.example.com, not onmta-sts.example.com(the website’s name, with no underscore) or on the domain itself. - The record doesn’t begin with exactly
v=STSv1. DownBad counts a record only when those seven characters, withSTSin capitals, come first.
Check it yourself
Section titled “Check it yourself”These commands only read, and change nothing. Run them in a terminal (the
window where you type commands: Terminal on a Mac, PowerShell on Windows). Put
your domain in place of example.com.
1. Look up the record. This asks DNS for the TXT record at _mta-sts
under your domain.
dig +short TXT _mta-sts.example.comdig is a tool that asks DNS one question and prints the answer.
+short prints only the records.
dig +short TXT _mta-sts.example.comdig is a tool that asks DNS one question and prints the answer.
+short prints only the records. If dig isn’t installed, install the
dnsutils package on Ubuntu or Debian, or bind-utils on Fedora or Red
Hat, with your system’s package manager.
nslookup -type=TXT _mta-sts.example.comnslookup is the tool Windows includes for asking DNS a question; its
options are in
Microsoft’s nslookup reference.
When the record is there, it prints it in quotes, beginning v=STSv1.
When it isn’t, it prints no quoted record.
"v=STSv1; id=20190429T010101;"That is what it printed for gmail.com. If it fails, the command prints
nothing at all, as it did for example.com.
2. Fetch the policy file. This asks the policy file’s website for the file, the way a sending mail server does.
curl -sS https://mta-sts.example.com/.well-known/mta-sts.txtcurl fetches a web address and prints what comes back. -sS hides
its progress bar but still shows errors.
curl -sS https://mta-sts.example.com/.well-known/mta-sts.txtcurl fetches a web address and prints what comes back. -sS hides
its progress bar but still shows errors.
curl.exe -sS https://mta-sts.example.com/.well-known/mta-sts.txtType curl.exe, not curl, which PowerShell treats as a different
command. curl fetches a web address and prints what comes back. -sS
hides its progress bar but still shows errors. It prints the same kind of
output as the other tabs.
version: STSv1mode: enforcemx: smtp.google.commx: gmail-smtp-in.l.google.commx: *.gmail-smtp-in.l.google.commax_age: 86400That is Gmail’s policy file. Each mx: line names a mail server that may
receive the domain’s mail.
curl: (6) Could not resolve host: mta-sts.example.comAny other error, or a web page instead of lines like the ones above, means the policy file isn’t published where sending servers look for it.
Without a terminal: open Google Public DNS,
Google’s free lookup page. Enter _mta-sts. followed by your domain under
DNS Name, choose TXT under RR Type, and press Resolve. When the
record is there, the result has an Answer section whose data line begins
v=STSv1. When it isn’t, there’s no Answer section. For the policy file,
open its address in a browser: when it’s published, the browser shows the
lines of the file.
In DownBad, the domain’s page (open Watching, then the domain) shows an MTA-STS chip under Email Security. It shows what DownBad’s last lookup found, not what DNS says now.
Fix it
Section titled “Fix it”The causes below run from most to least likely, so start with the first.
You’ve decided you don’t need it
Section titled “You’ve decided you don’t need it”This is the cause when nobody sends email to addresses at this domain, or you don’t want to run a website for the policy file.
-
On Now, open the MTA-STS item in the Hardening checklist and press Dismiss. That dismisses it for every domain it lists, and each one counts as done in the checklist’s percentage.
-
To bring a domain back, press Show N dismissed items under the checklist, where N is how many are dismissed, and press Restore beside the domain.
MTA-STS isn’t set up
Section titled “MTA-STS isn’t set up”This is the cause when the domain receives email, you want MTA-STS, and step 1 of Check it yourself printed nothing. Some mail providers document their own MTA-STS setup, so look in your provider’s help first: Google’s MTA-STS page covers Google Workspace.
-
Write the policy file. Start in
testingmode, in which sending servers still deliver your mail when its checks fail:version: STSv1mode: testingmx: mail.example.commax_age: 86400Put one
mx:line for each of your domain’s mail servers in place ofmail.example.com, keeping your own names. Your mail provider’s setup guide lists them.max_ageis how many seconds a sending server may remember the policy; keep your own value if your provider gives one. -
Publish the file at
https://mta-sts.example.com/.well-known/mta-sts.txt, with your domain in place ofexample.com. The website atmta-sts.example.comneeds a valid certificate for that name, and the name needs its own DNS record pointing at the server that publishes the file. Step 2 of Check it yourself then prints the file. -
Add a record of type
TXTnamed_mta-stsat your DNS host (the company whose servers answer DNS questions for your domain), with a value such asv=STSv1; id=20261120T000000;. Theidcan be any letters and digits, up to 32 of them; change it each time you change the policy file, so sending servers fetch the new one. Your DNS host’s own guide shows where to add a record: for example Cloudflare, DigitalOcean or Amazon Route 53. -
Once mail has kept arriving for a while, change
mode: testingtomode: enforcein the file, and change theidin the TXT record.
Confirm DownBad sees the fix
Section titled “Confirm DownBad sees the fix”DownBad doesn’t look at your domain again by itself for the Hardening checklist. The checklist reads the newest discovery report for the domain: the lookup DownBad makes when you add a domain, and again each time you rediscover it. checked, beside the checklist, says how long ago the newest report was made.
-
Run the command in Check it yourself again, and wait until it shows the record you added. A DNS server that already looked for the record and found nothing can keep giving that answer for a while after you add it, and DownBad’s lookup can get the same old answer.
-
In DownBad, open Watching and then the domain, to reach the domain’s page. Press Rediscover. DownBad looks the domain up again and lists what differs from the saved report. Nothing is saved yet.
-
Press Save. The new lookup becomes the domain’s newest discovery report.
-
Open Now and reload it. The domain’s pill on this item now counts as done, and checked shows the time of the new lookup. Now shows the checklist only while no incident is open.
If the item is still there after you saved, the new lookup didn’t find the record either. Go back to Is it you or us?, which lists the reasons DownBad can miss a record that is there.
Still stuck
Section titled “Still stuck”Before you ask for help, collect:
- the domain’s name, and when checked says DownBad last looked
- the output of both commands in Check it yourself, and when you ran them
- the record exactly as you entered it at your DNS host
Then send all of it to us through Contact Us.