SMTP port 25 does not advertise STARTTLS after update to Stalwart 0.16.25 on TrueNAS

Issue Description

After updating to Stalwart 0.16.25, I noticed that the SMTP listener on port 25 no longer advertised STARTTLS.

Google TLS-RPT reported incoming TLS failures with:

result-type: starttls-not-supported

Testing the SMTP listener confirmed that EHLO did not contain “250-STARTTLS”.

Stalwart is running as an application on TrueNAS 25.10.3.1 (Stalwart app package 2.0.17).

I eventually found that the generated “tn-smtp” listener was configured with TLS disabled. Manually enabling TLS in the Stalwart UI did not persist after restarting/redeploying the application.

Expected Behavior

The SMTP listener on port 25 should support explicit TLS (STARTTLS):

useTls = true
tlsImplicit = false

After EHLO, the server should advertise:

250-STARTTLS

Port 25 should remain standard SMTP with STARTTLS and should not use implicit TLS.

Reproduction Steps

  1. Run Stalwart 0.16.25 using the TrueNAS Stalwart application package 2.0.17.

  2. Configure the TrueNAS SMTP port as TCP 25.

  3. Start/redeploy the application.

  4. Connect to port 25 and send an EHLO command:

    nc 25
    EHLO test.example

  5. Observe that the SMTP capabilities do not include:

    250-STARTTLS

  6. In the Stalwart web interface, open the generated “tn-smtp” listener and enable TLS while keeping Implicit TLS disabled.

  7. Restart/redeploy the Stalwart application from TrueNAS.

  8. Check the “tn-smtp” listener again. TLS has been disabled again and STARTTLS is no longer advertised.

The TrueNAS application template generates the listener using the same boolean value for both useTls and tlsImplicit.

For SMTP port 25, the generated configuration is therefore:

useTls = false
tlsImplicit = false

I tested changing the generated configuration for “tn-smtp” to:

useTls = true
tlsImplicit = false

After redeploying the application, STARTTLS is advertised and works correctly.

Relevant Log Output

Before the change:

220 mail.example.net Stalwart ESMTP at your service
EHLO test.example
250-mail.example.net you had me at EHLO
250-SMTPUTF8
250-SIZE 104857600
250-REQUIRETLS
250-PIPELINING
250-NO-SOLICITING
250-ENHANCEDSTATUSCODES
250-CHUNKING
250-BINARYMIME
250 8BITMIME

There is no 250-STARTTLS capability.

Google TLS-RPT also reported:

result-type: starttls-not-supported

After setting useTls=true and tlsImplicit=false for tn-smtp:

250-mail.example.net you had me at EHLO
250-STARTTLS
250-SMTPUTF8
...

External verification:

openssl s_client -starttls smtp -connect <public-ip>:25 -servername mail.example.net

Result:

Verification: OK
New, TLSv1.3
Verify return code: 0 (ok)

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

Filesystem

Search Engine

Internal

Directory Backend

Internal

Additional Context

This report is provided for information and reproducibility. I do not require support or troubleshooting assistance

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

This confirms the docs’ expected config matches what you found: useTls: true, tlsImplicit: false for port 25 (explicit STARTTLS), and tlsImplicit: true only for port 465 (implicit TLS submissions). Port 25 should never use tlsImplicit: true.

This is a bug in the TrueNAS application template/packaging (which generates the tn-smtp listener with useTls and tlsImplicit tied to the same boolean), not in Stalwart itself — the underlying NetworkListener object behaves correctly once configured with the right values, as you confirmed. Since the issue is in the TrueNAS app’s templating of the listener config rather than Stalwart’s server code, it would need to be fixed in the TrueNAS app package (2.0.17), not in Stalwart core. Your workaround (manually setting useTls=true, tlsImplicit=false in the generated config) is the correct configuration per the Listener TLS docs.

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

That matches what Stalwart expects: on 25 and 587 the listener needs useTls on and tlsImplicit off, and useTls off removes STARTTLS altogether. The tn-smtp listener comes from the TrueNAS app, which re-applies it on every deploy, so the template was the right place to fix it. An issue at GitHub - truenas/apps: This repository contains the Docker-Compose based App catalog used by TrueNAS systems to render and update the Apps catalog. · GitHub would get the default corrected for other TrueNAS users. Listener fields: NetworkListener | Stalwart