Skip to content

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.

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, beginning v=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.

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 on mta-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, with STS in capitals, come first.

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.

Terminal window
dig +short TXT _mta-sts.example.com

dig is a tool that asks DNS one question and prints the answer. +short prints only the records.

If it works
"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.

Terminal window
curl -sS https://mta-sts.example.com/.well-known/mta-sts.txt

curl fetches a web address and prints what comes back. -sS hides its progress bar but still shows errors.

If it works
version: STSv1
mode: enforce
mx: smtp.google.com
mx: gmail-smtp-in.l.google.com
mx: *.gmail-smtp-in.l.google.com
max_age: 86400

That is Gmail’s policy file. Each mx: line names a mail server that may receive the domain’s mail.

If there's no website for the file
curl: (6) Could not resolve host: mta-sts.example.com

Any 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.

The causes below run from most to least likely, so start with the first.

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.

  1. 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.

  2. 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.

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.

  1. Write the policy file. Start in testing mode, in which sending servers still deliver your mail when its checks fail:

    version: STSv1
    mode: testing
    mx: mail.example.com
    max_age: 86400

    Put one mx: line for each of your domain’s mail servers in place of mail.example.com, keeping your own names. Your mail provider’s setup guide lists them. max_age is how many seconds a sending server may remember the policy; keep your own value if your provider gives one.

  2. Publish the file at https://mta-sts.example.com/.well-known/mta-sts.txt, with your domain in place of example.com. The website at mta-sts.example.com needs 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.

  3. Add a record of type TXT named _mta-sts at your DNS host (the company whose servers answer DNS questions for your domain), with a value such as v=STSv1; id=20261120T000000;. The id can 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.

  4. Once mail has kept arriving for a while, change mode: testing to mode: enforce in the file, and change the id in the TXT record.

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.

  1. 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.

  2. 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.

  3. Press Save. The new lookup becomes the domain’s newest discovery report.

  4. 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.

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.