Skip to content

fix(mail): reconcile mounted Let's Encrypt certificates into daemon paths on boot - #838

Open
lagmandu wants to merge 1 commit into
oblien:mainfrom
lagmandu:fix/mail-ssl-reconcile
Open

lagmandu wants to merge 1 commit into
oblien:mainfrom
lagmandu:fix/mail-ssl-reconcile

Conversation

@lagmandu

@lagmandu lagmandu commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Postfix and Dovecot inside the \openship-mail\ container load certificates from /etc/ssl/certs/iRedMail.crt\ and /etc/ssl/private/iRedMail.key.

Because /etc/ssl\ is inside the ephemeral container layer (not a persistent volume), recreating the container or updating the image reverts /etc/ssl\ to the baked self-signed certificates — even when valid certificates are mounted at /etc/letsencrypt.

As a result, applications and clients connecting via STARTTLS on port 587 or SSL on 465 (like Node.js / nodemailer, Python, or mail clients) fail with:
\
Error: self-signed certificate (code: ESOCKET, command: CONN)
\\

This PR adds a reconciliation step (\3c) to \�pps/email/docker/entrypoint.sh\ that checks for \mail.\ (or \) under /etc/letsencrypt/live/\ on every boot and symlinks \ ullchain.pem\ and \privkey.pem\ into the default daemon certificate paths.

Fixes #837

Verification

  • Added and ran unit tests: \�pps/api/test/lib/mail-ssl-reconcile.test.ts\
  • Formatted with Prettier
  • Tested certificate reconciliation and TLS handshake with \openssl s_client -connect 127.0.0.1:587 -starttls smtp\ verifying \Verify return code: 0 (ok)\
  • Verified Node.js client (
    odemailer.createTransport().verify()) succeeds without certificate rejection

…aths on boot

Postfix and Dovecot inside the openship-mail container load certificates from /etc/ssl/certs/iRedMail.crt and /etc/ssl/private/iRedMail.key. Because /etc/ssl is ephemeral, container recreations and image updates revert to the baked self-signed certificates even when valid certificates are mounted at /etc/letsencrypt.

This reconciles /etc/letsencrypt certificates on every boot into the daemon paths if present, ensuring TLS clients never fail with self-signed certificate errors.

Fixes oblien#837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] openship-mail: Postfix and Dovecot fall back to self-signed certificate when Let's Encrypt cert is mounted

1 participant