# MTA-STS policy is present but has unexpected settings

**URL:** <https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061>\
**Category:** Unsupported Modifications\
**Created:** [May 5, 2022, 2:44pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061 "2022-05-05T14:44:10Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 5, 2022, 2:44pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/1 "2022-05-05T14:44:11Z")

</div>

I’m seeing this error in my system status, but I can’t see what I’ve done wrong:

`MTA-STS policy is present but has unexpected settings. [{'mx': ['post.madra.net'], 'version': 'STSv1', 'mode': 'testing', 'max_age': 86400}]`

Here is my MTA-STS file:

[https://mta-sts.madra.net/.well-known/mta-sts.txt](https://mta-sts.madra.net/.well-known/mta-sts.txt)

```auto
version: STSv1
mode: testing
mx: post.madra.net
max_age: 86400

```

Where’s the problem?

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [May 5, 2022, 2:46pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/2 "2022-05-05T14:46:29Z")

</div>

Maybe it should be `mode: enforce`?

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 5, 2022, 2:48pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/3 "2022-05-05T14:48:36Z")

</div>

Hmmm… I suppose it could be that. But all the tutorials I’ve read on setting up MTA-STS say to set it to `testing` first, until you’re sure it’s working OK… which is a bit of a Catch22 if MIAB flags the fact you’ve set it to `testing` as an error, in itself.

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [May 5, 2022, 2:49pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/4 "2022-05-05T14:49:17Z")

</div>

MiaB configures everything for MTA-STS automatically.

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 5, 2022, 2:50pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/5 "2022-05-05T14:50:02Z")

</div>

I’m using external DNS, so lots of manual config of these kind of settings

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [May 5, 2022, 2:56pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/6 "2022-05-05T14:56:41Z")

</div>

Those MTA-STS settings are hosted on the server. External DNS should just be configured to support the DNS records, not the text file served by the server.

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 5, 2022, 3:11pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/7 "2022-05-05T15:11:53Z")

</div>

My MIAB server runs on a subdomain of a domain which is located on a different server. So the DNS records have to all be set on the server where the TLD is located, not on the MIAB server.

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [May 5, 2022, 3:16pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/8 "2022-05-05T15:16:13Z")

</div>

The default MTA-STS file is located at `/var/lib/mailinabox/mta-sts.txt`. This is independent of DNS records.

Your server configuration is highly unusual and falls into the category of unsupported modifications because the use case is outside the scope of what the project is intended to support. This is why I keep changing the category (which plenty of posts and users make use of, myself included).

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 5, 2022, 3:19pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/9 "2022-05-05T15:19:30Z")

</div>

Hmmm… I think I may be onto something now. I just checked using an external validator and got a slightly different error message:

> **[MTA-STS validator - Mailhardener tools](https://www.mailhardener.com/tools/mta-sts-validator?domain=post.madra.net)**
>
> With this tool you can inspect and validate a MTA-STS policy and DNS record. We'll test all requirements from the MTA-STS standard.

 ![SS 2022-05-05 at 16.15.52](https://discourse.mailinabox.email/uploads/default/original/2X/1/1f0e2c0a2e0440c9aecb7855a7bdba708e477e49.png)

EDIT: D’oh! --I just realised I checked the subdomain my MIAB was on with that external validator, instead of the actual TLD itself. That seems to check out OK:

 ![SS 2022-05-05 at 17.25.57](https://discourse.mailinabox.email/uploads/default/original/2X/e/ec20d7a6e784b6733688d3bfb8ca5a49ea79ce51.png)

So I’m now leaning to the opinion that the MIAB error is spurious and caused by the fact is [I assume!] MIAB expects to be running on its own domain, as opposed to a subdomain [as in my case] of a domain served from elsewhere.

---

<div class="post-metadata">

**Author:** ![stylnchris](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stylnchris/32/2189_2.png) [@stylnchris](https://discourse.mailinabox.email/u/stylnchris)\
**Post date:** [May 5, 2022, 5:31pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/10 "2022-05-05T17:31:51Z")

</div>

I think your missing the entry for the sub domain.

\_mta-sta.subdomain.domain.tld

So in your case external DNS your missing the \_mta-sta.post entry.

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 5, 2022, 7:13pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/11 "2022-05-05T19:13:36Z")

</div>

> [@stylnchris](#):
>
> I think your missing the entry for the sub domain…

This is where I get a bit confused.

Should I have one single MTA-STS record setup on the MIAB server itself [ie. on the `mta-sts.post.madra.net` sub-sub-domain --given my MIAB server runs on a sub-domain itself: `post.madra.net`]?

Or does each domain for which the MIAB server serves mail need its own MTA-STS records eg: `mta-sts.somedomain.com`, `mta-sts.otherdomain.com`, `mta-sts.thirddomain.com`?

---

<div class="post-metadata">

**Author:** ![stylnchris](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stylnchris/32/2189_2.png) [@stylnchris](https://discourse.mailinabox.email/u/stylnchris)\
**Post date:** [May 5, 2022, 11:58pm UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/12 "2022-05-05T23:58:56Z")

</div>

I believe each domain that MiaB services, weather its the naked domain [domain.com](http://domain.com) or the subdomain [subdomain.domain.com](http://subdomain.domain.com) would need the records.

Look in your admin page, then to system → external dns tab.

You should see an entry there for both [post.madra.net](http://post.madra.net) and [madra.net](http://madra.net) if your box also hosts another domain (say [example.com](http://example.com)) then there will be an mta-sta record for that as well. [mta-sts.example.com](http://mta-sts.example.com) which would be needed to be in DNS.

---

<div class="post-metadata">

**Author:** ![miabuser](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@miabuser](https://discourse.mailinabox.email/u/miabuser)\
**Post date:** [May 6, 2022, 5:14am UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/13 "2022-05-06T05:14:16Z")

</div>

Hi @stuzbot

You need at least two DNS records for each domain you serve mail from:

1. Either a CNAME record or an A record for the mta-sts subdomain:

2. A text record containing a serial number like this:

In order to receive reports you could add a third record with a valid email address like this:

```
_smtp._tls.domain.tld. IN	TXT	"v=TLSRPTv1; rua=mailto:mta-sts@domain.tld"

```

Here is a good article about the topic: [MTA-STS explained](https://www.uriports.com/blog/mta-sts-explained/)

I also recommend reading the instructions from Google: [About MTA-STS and TLS reporting - Google Workspace Admin Help](https://support.google.com/a/answer/9261504?hl=en&ref_topic=9261406)

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 6, 2022, 7:41am UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/14 "2022-05-06T07:41:52Z")

</div>

I got it sussed eventually by reading through the ‘Status Checks Change Notice’ emails from my MIAB [about which [more in another post](https://discourse.mailinabox.email/t/status-checks-change-notice-error-handling/9063)!] and seeing entries for a missing MTS-STS policy for each of my other domains.

So, I’ve now created an `mta-sts.domain.com` sub-domain for every domain my MIAB is serving email for and all the appropriate DNS records and my MIAB status checks are a lot happier. Though I am still getting that ‘unexpected content’ error for each one. However the other external checkers I’ve tried have given everything the green iight. So I’m asuming @openletter’s theory is right anf that MIAB is just complaining because my mode is set to `testing`.

---

<div class="post-metadata">

**Author:** ![miabuser](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@miabuser](https://discourse.mailinabox.email/u/miabuser)\
**Post date:** [May 6, 2022, 8:15am UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/15 "2022-05-06T08:15:25Z")

</div>

> [@stuzbot](#):
>
> @openletter’s theory is right anf that MIAB is just complaining because my mode is set to `testing`.

Yes. Probably it’s just how MiaB queries the mta-sts.txt. Maybe you can take a look at the code on GitHub if you want to be sure. But I think you should be fine if the DNS records are correct. At least the contents of the file look fine to me. Not much you could do wrong on that four lines anyways 😉

---

<div class="post-metadata">

**Author:** ![stuzbot](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/stuzbot/32/2185_2.png) [@stuzbot](https://discourse.mailinabox.email/u/stuzbot)\
**Post date:** [May 7, 2022, 8:24am UTC](https://discourse.mailinabox.email/t/mta-sts-policy-is-present-but-has-unexpected-settings/9061/16 "2022-05-07T08:24:05Z")

</div>

Well, oddly enough, and without me making any further changes to my setup, this morning’s status email is reporting nothing untoward at all.

 ![Screenshot_20220507-091657_Aqua Mail](https://discourse.mailinabox.email/uploads/default/original/2X/c/c13b5ff072d82365e8418befd991c2cc8b475a4a.jpeg)

Looks like MIAB is one of those nice software packages that comes bundled with magic pixies, who fix things while you sleep.
