Issue Description
Stalwart Server v0.16.9 (Docker)
Environment
- Docker deployment
- ACME configured using TLS-ALPN-01
- Certificate hostname: mail.junk.frankpannier.online
- Default hostname: mail.junk.frankpannier.online
- Default certificate: mail.junk.frankpannier.online
Certificate Details
- Issuer: Let’s Encrypt (YE1)
- Valid From: 19 Jun 2026
- Expires: 17 Sep 2026
- SAN: mail.junk.frankpannier.online
Observed Behaviour
HTTPS presents the correct Let’s Encrypt certificate:
openssl s_client -connect localhost:443 -servername mail.junk.frankpannier.online </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer
Result:
subject=CN = mail.junk.frankpannier.online
issuer=C = US, O = Let's Encrypt, CN = YE1
IMAPS presents the built-in rcgen certificate:
openssl s_client -connect localhost:993 -servername mail.junk.frankpannier.online </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer
Result:
subject=CN = rcgen self signed cert
issuer=CN = rcgen self signed cert
SMTPS presents the built-in rcgen certificate:
openssl s_client -connect localhost:465 -servername mail.junk.frankpannier.online </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer
Result:
subject=CN = rcgen self signed cert
issuer=CN = rcgen self signed cert
Additional Information
- Mail services are functioning correctly.
- SMTP sending works via SMTP2GO relay.
- IMAP access works.
- DNS is correct.
- ACME certificate is valid and visible in the Stalwart UI.
- The certificate is configured as the Default Certificate in Network Settings.
- HTTPS uses the certificate correctly, but IMAPS and SMTPS continue to serve rcgen.
Question
Is there a separate certificate binding or listener configuration required for SMTP/IMAP listeners in v0.16.9, or is this a known issue?
Expected Behavior
A valid Let’s Encrypt certificate configured as the default certificate should be presented consistently across all TLS-enabled services, including HTTPS, IMAPS and SMTPS.
The certificate currently configured in Stalwart (mail.junk.frankpannier.online) should be served on ports 443, 993 and 465 when clients connect using SNI hostname mail.junk.frankpannier.online.
Actual Behavior
HTTPS (port 443) presents the correct Let’s Encrypt certificate:
CN = mail.junk.frankpannier.online
Issuer = Let’s Encrypt (YE1)
However, IMAPS (port 993) and SMTPS (port 465) present the built-in rcgen self-signed certificate:
CN = rcgen self signed cert
Issuer = rcgen self signed cert
Mail functionality itself appears normal. The issue is limited to certificate presentation on the mail listeners.
Reproduction Steps
- Deploy Stalwart Server v0.16.9 in Docker.
- Configure ACME using TLS-ALPN-01.
- Obtain a valid Let’s Encrypt certificate for mail.junk.frankpannier.online.
- Set the certificate as the Default Certificate in Network Settings.
- Verify HTTPS:
openssl s_client -connect localhost:443 -servername mail.junk.frankpannier.online
Result: Let’s Encrypt certificate presented.
- Verify IMAPS:
openssl s_client -connect localhost:993 -servername mail.junk.frankpannier.online
Result: rcgen self-signed certificate presented.
- Verify SMTPS:
openssl s_client -connect localhost:465 -servername mail.junk.frankpannier.online
Result: rcgen self-signed certificate presented.
Relevant Log Output
No relevant certificate-related messages are present in the container logs at the default logging level.
Stalwart Version
v0.16.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
Docker deployment.
Certificate details:
- Hostname: mail.junk.frankpannier.online
- SAN: mail.junk.frankpannier.online
- Issuer: Let’s Encrypt (YE1)
- Valid until 17 September 2026
Network Settings:
- Default Hostname: mail.junk.frankpannier.online
- Default Domain: junk.frankpannier.online
- Default Certificate: mail.junk.frankpannier.online
Localhost testing confirms:
443 → Let’s Encrypt certificate
993 → rcgen self-signed certificate
465 → rcgen self-signed certificate
The issue is reproducible both externally and from localhost, ruling out DNS, Cloudflare, firewall and reverse proxy configuration.
A localhost test confirms that the issue occurs entirely within Stalwart itself. HTTPS (443) presents the Let’s Encrypt certificate while IMAPS (993) and SMTPS (465) present the built-in rcgen certificate, despite the same default certificate being configured globally.
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