TransIP DNS requires trailing dot in MX-record

Issue Description

TransIP DNS has been severly improved since 0.16.7, but the logs show 2 pending issues with a TXT/CNAME(?) and MX record.

I’m not entirely sure, but I think the second failure is a consequence of the first one.

Please note in the screenshot that the mail-CNAME was manually added by me earlier.

Relevant Log Output

Failed to set DNS RRSet for mail.onderzone.nl.

/TXT: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A CNAME’s name must be unique, there cannot exist other records with the same name according to RFC 1035.: mail 3600 CNAME @”}; Failed to set DNS RRSet for onderzone.nl.

/MX: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example.com.”): @ 300 MX 10 mail.onderzone.nl”}

(removed personal/irrelevant records)

Stalwart Version

v0.16.x

Installation Method

Binary (Linux)

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Let me look into how Stalwart formats MX records for DNS providers, particularly around the trailing dot requirement.

The two errors are coming from the dns-update library (an external crate) used by Stalwart to talk to the TransIP API. Both are TransIP API-level rejections:

Error 1 - TXT record on mail.onderzone.nl:

A CNAME's name must be unique, there cannot exist other records with the same name ... mail 3600 CNAME @

TransIP is rejecting the attempt to add a TXT record to mail.onderzone.nl because that hostname already has a CNAME record pointing to the zone apex (@). RFC 1035 forbids any other record type coexisting with a CNAME. This is a DNS configuration conflict on the TransIP side, not a Stalwart bug. You need to remove or rename the existing CNAME for mail before Stalwart can set the TXT record there.

Error 2 - MX record for onderzone.nl:

A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. "example.com."): @ 300 MX 10 mail.onderzone.nl

TransIP requires that the MX target hostname be a fully-qualified domain name (FQDN) with a trailing dot (e.g. mail.onderzone.nl.). Stalwart is currently sending mail.onderzone.nl without the trailing dot when it calls the TransIP API. This is a formatting issue in how the dns-update library constructs the MX record for TransIP’s API.

What you can do:

  • For Error 1: Log into TransIP and delete the mail CNAME @ record. Once removed, Stalwart’s automatic DNS provisioning should be able to set the TXT record on the next attempt.
  • For Error 2: This is a bug in how MX records are formatted for TransIP (missing trailing dot on the exchange hostname). This should be reported against the dns-update library (used by Stalwart) so the TransIP provider can add the trailing dot to MX targets. In the meantime, you can manually create the MX record in TransIP as @ 300 MX 10 mail.onderzone.nl. (with the trailing dot).

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

We will have to wait until someone contributes a fix as we don’t have an API key to debug.

I removed all mail-related records entirely and re-ran the DNS update task.

It is not happy.

By the way, this ticketing system converts any domain to a hyperlink whether you want it or not, and then complains that there are only 2 links allowed for my user level. Converted dots to commas for now.

Failed to set DNS RRSet for _pop3s._tcp.onderzone.nl.

/SRV: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): _pop3s._tcp 300 SRV 0 1 995 mail.onderzone.nl.”};

Failed to set DNS RRSet for autoconfig.onderzone.nl.

/CNAME: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): autoconfig 300 CNAME mail.onderzone.nl.”};

Failed to set DNS RRSet for mta-sts.onderzone.nl.

/CNAME: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): mta-sts 300 CNAME mail.onderzone.nl.”};

Failed to set DNS RRSet for onderzone.nl.

/MX: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): @ 300 MX 10 mail.onderzone.nl”};

Failed to set DNS RRSet for _caldavs._tcp.onderzone.nl.

/SRV: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): _caldavs._tcp 300 SRV 0 1 443 mail.onderzone.nl.”};

Failed to set DNS RRSet for ua-auto-config.onderzone.nl.

/CNAME: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): ua-auto-config 300 CNAME mail.onderzone.nl.”};

Failed to set DNS RRSet for _jmap._tcp.onderzone.nl.

/SRV: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): _jmap._tcp 300 SRV 0 1 443 mail.onderzone.nl.”};

Failed to set DNS RRSet for _submissions._tcp.onderzone.nl.

/SRV: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): _submissions._tcp 300 SRV 0 1 465 mail.onderzone.nl.”};

Failed to set DNS RRSet for _carddavs._tcp.onderzone.nl.

/SRV: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): _carddavs._tcp 300 SRV 0 1 443 mail.onderzone.nl.”};

Failed to set DNS RRSet for _imaps._tcp.onderzone.nl.

/SRV: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. “example,com.”): _imaps._tcp 300 SRV 0 1 993 mail.onderzone.nl.”}

These succeeded:

I tried it another way.

My mail.-subdomain used to be a CNAME-record. Manually added it as an A-record and re-ran the task.

This time there is only one error left about the absence of a trailing dot in the MX-record:

Failed to set DNS RRSet for onderzone.nl.

/MX: Failed to set DNS RRSet: API error: HTTP 406: {“error”:“A hostname for a CNAME, NS, MX or SRV record was not found (external hostnames need a trailing dot, eg. "example.com."): @ 300 MX 10 mail.onderzone.nl”}

All other records are OK. Will add the MX manually for now.