Your question
Environment
- Stalwart Mail Server: v0.16.26
- Linux / Docker
- Automatic certificate and DNS management enabled (DKIM and TLSA only)
Question
I am reviewing the TLSA records automatically generated by Stalwart for my SMTP MX hosts.
Stalwart currently publishes an RRset in this form:
2 1 1 <CA/intermediate SPKI SHA-256>
2 1 1 <CA/intermediate SPKI SHA-256>
2 1 1 <CA/intermediate SPKI SHA-256>
3 1 1 <leaf certificate SPKI SHA-256>
I have verified that DNSSEC validation succeeds and that the 3 1 1 record exactly matches the SPKI SHA-256 hash of the certificate actually presented by the SMTP server.
I also found the previous forum discussions explaining that Stalwart intentionally generates 3 1 1 for the end-entity certificate and 2 1 1 for additional certificates in the presented chain, so I understand that the 2 1 1 records are intentional rather than accidental.
However, I would like to clarify a few details about the design and configuration.
1. Why does Stalwart use 2 1 1 for DANE-TA?
RFC 7672 permits SPKI selector 1 for DANE-TA, but recommends 2 0 1 when DANE-TA is used, while 3 1 1 is generally recommended for DANE-EE.
Some external validators, for example Mailhardener, therefore flag the automatically generated 2 1 1 records as non-recommended/invalid for SMTP.
Is there a particular reason Stalwart prefers:
2 1 1
over:
2 0 1
for the additional certificates in the chain?
I am not reporting an interoperability failure here — I understand that 2 1 1 is permitted by the RFC. I am mainly interested in the rationale behind the choice.
2. Which certificates are used for the 2 1 1 records?
Does Stalwart generate one DANE-TA record for every non-leaf certificate actually sent in the SMTP TLS handshake, or is there additional logic determining which chain certificates become TLSA records?
For example, if the presented chain changes because the ACME CA changes its intermediate certificate, will the corresponding TLSA RRset automatically change as well?
3. How is certificate/TLSA rollover handled?
When the certificate chain changes, how does Stalwart avoid a temporary DANE mismatch caused by DNS caching?
Does it perform a sequence similar to:
publish new TLSA records
→ wait for the previous TTL
→ switch to the new certificate/chain
→ later remove obsolete TLSA records
or is rollover handled differently?
This is probably the part I am most interested in, since an incorrect ordering could temporarily prevent delivery from DANE-validating MTAs.
4. Is the generated TLSA profile configurable?
Is there currently any supported configuration option to control which TLSA records automatic DNS management publishes?
For example, can an administrator choose:
3 1 1 only
or use:
2 0 1 + 3 1 1
instead of the default 2 1 1 + 3 1 1 set, while still retaining automatic certificate and DNS management?
If this is currently fixed behaviour, would configurability of the TLSA publication profile be considered appropriate as a feature request?