Skip to content
Module 4 · Lesson 9 of 25

Let's Encrypt auto-renewal hook

Part of Dovecot: IMAP/POP3 at Production Scale, in the SSL/TLS, Certificates, and Ports module.

Author

Certbot renews certs in place but doesn't restart Dovecot. Without a reload, you keep serving the old cert until Dovecot restarts.

Add a deploy hook in /etc/letsencrypt/renewal-hooks/deploy/reload-dovecot.sh:

#!/bin/bash
systemctl reload dovecot
systemctl reload postfix
chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-dovecot.sh

Test certificate from outside:

openssl s_client -connect mail.example.com:993 -servername mail.example.com -showcerts < /dev/null | grep "Verify return code"

Want Verify return code: 0 (ok).

SNI for multiple hostnames: add per-name blocks:

local_name imap.alt.example {
  ssl_cert = </etc/letsencrypt/live/imap.alt.example/fullchain.pem
  ssl_key  = </etc/letsencrypt/live/imap.alt.example/privkey.pem
}

Sign in to keep track of what you have read.

Pulse · email sending

Sending infrastructure that is yours alone.

Every domain gets its own MX host, IP, DKIM selector and certificate. Take it managed, and we run it for you, or buy a licence and run it on your own servers.

# on a fresh Ubuntu server
$ cd pulse && sudo ./install.sh
→ docker compose up · kumomta · stalwart · caddy
→ dashboard ready on https://pulse.yourdomain.com
$

Also from us:Beat: monitoring that tells you the fixConsulting: $65/hr, no retainer