What a Dovecot incident on Fedora Linux reveals about the hidden failure modes of automated certificate management.
An automated certificate renewal process can succeed while a production service continues to present an expired certificate. The certificate authority has issued a replacement, the ACME client has updated the files on disk, and the application is still running. Yet users are confronted with a security warning.
A recent incident involving Dovecot and Let’s Encrypt illustrates why certificate issuance, deployment, presentation, and validation must be treated as distinct stages of the certificate lifecycle. The fix is comparatively simple. The operational lesson is considerably broader.
An expired certificate that had already been renewed
On December 4, 2026, a mail client attempting to establish an encrypted IMAP connection over TCP port 993 reported that the server certificate had expired. The certificate had been issued on September 5, 2026, and reached its expiration date on December 4.
Certbot already held a valid replacement certificate expiring in March 2027. The available evidence pointed strongly toward a certificate deployment problem rather than an issuance failure. A forced renewal during troubleshooting produced another valid certificate; following a Dovecot reload, a local TLS handshake confirmed that the service presented that replacement.
The precise original failure mechanism was not conclusively established: no independent pre-reload TLS capture was recorded, and alternative deployment mechanisms were not exhaustively investigated. The incident nevertheless demonstrates a failure mode that administrators should explicitly guard against.
1. Establish the scope of the incident
Before modifying configuration or requesting another certificate, distinguish DNS, TCP connectivity, TLS, and application-layer failures. Throughout this article, mail.example.com is a placeholder for the public hostname of the affected gateway.
If you work on a Windows workstation, check DNS resolution and TCP connectivity with PowerShell:
Resolve-DnsName mail.example.com -Server 1.1.1.1
Test-NetConnection mail.example.com -Port 993
On Fedora, identify the listener:
sudo ss -ltnp ‘sport = :993’
In the incident, Dovecot and its IMAP login processes were listening on both IPv4 and IPv6, at 0.0.0.0:993 and [::]:993. DNS resolution was also successful. A local listening socket does not, however, establish that the service is reachable from the public Internet. Firewalls, routing and intermediate TLS termination remain separate considerations.
2. Separate certificate issuance from deployment
Inspect the certificates managed by Certbot:
sudo certbot certificates
The output identifies the certificate name, associated domains, validity period and paths to the certificate and private key. A typical certificate lineage uses these files:
/etc/letsencrypt/live/mail.example.com/fullchain.pem
/etc/letsencrypt/live/mail.example.com/privkey.pem
Certbot maintains the certificate lineage, including the live paths that normally point to the current version of the certificate material. Updating those files does not inherently guarantee that every consuming application has loaded them. The running service and the filesystem can represent different states of the same infrastructure.
3. Find the correct Fedora renewal timer
Administrators accustomed to other Linux distributions may initially check certbot.timer. On this Fedora installation, that unit did not exist. The packaged Fedora timer uses a different name: certbot-renew.timer.
sudo systemctl status certbot-renew.timer
sudo systemctl enable –now certbot-renew.timer
systemctl is-enabled certbot-renew.timer
systemctl is-active certbot-renew.timer
systemctl list-timers –all certbot-renew.timer
Review previous executions of the renewal service:
sudo journalctl -u certbot-renew.service \
–since ’30 days ago’ –no-pager
The timer was already present and scheduled in the investigated deployment. The absence of certbot.timer was a misleading diagnostic clue, not proof that certificate renewal had failed. Package names and scheduling arrangements can differ with installation method; inspect the actual units on the host.
4. Inspect the Dovecot TLS configuration
These commands are a good start:
dovecot –version
sudo doveconf -n | grep -E ‘^ssl_cert|^ssl_key’
For Dovecot 2.3, the relevant configuration is:
ssl_cert = </etc/letsencrypt/live/mail.example.com/fullchain.pem
ssl_key = </etc/letsencrypt/live/mail.example.com/privkey.pem
The leading less-than sign tells Dovecot 2.3 to read the setting from the specified file. The private key setting may be concealed in diagnostic output. This is intentional; do not expose private key material in logs or screenshots. Check for service-specific or SNI-specific overrides as appropriate.
Dovecot 2.4 uses different settings and syntax:
ssl_server_cert_file = /etc/letsencrypt/live/mail.example.com/fullchain.pem
ssl_server_key_file = /etc/letsencrypt/live/mail.example.com/privkey.pem
Use the syntax appropriate to the installed version. The affected Dovecot 2.3 service referenced the expected fullchain.pem path.
5. Force renewal only when necessary
Certbot can simulate certificate renewal using the staging environment:
sudo certbot renew –dry-run –cert-name mail.example.com
If a fresh production certificate is genuinely required, explicitly force renewal:
sudo certbot renew –force-renewal –cert-name mail.example.com
In this incident, a valid replacement was already present before the forced renewal. Requesting another certificate was thus unnecessary to resolve the suspected deployment failure.
Unnecessary forced renewals may encounter certificate authority rate limits. Let’s Encrypt exempts qualifying ACME Renewal Information (ARI) renewals from rate limits, but conventional requests may still be subject to issuance limits. Certbot 3.0.1 predates its ARI support.
6. Reload Dovecot
Restarting is not required. Reloading will suffice:
sudo systemctl reload dovecot.service
sudo systemctl status dovecot.service –no-pager
sudo journalctl -u dovecot.service -n 30 –no-pager
The investigated system reported a successful ExecReload invocation of doveadm reload, with exit status zero. Dovecot remained active. A reload generally avoids the disruption of a full restart, although application behavior and existing sessions must be considered. If the reload does not activate the expected certificate, investigate configuration overrides and logs before considering a controlled restart:
sudo systemctl restart dovecot.service
A successful reload is not itself proof that the application presents the expected certificate. That requires a fresh TLS handshake.
7. Inspect the live certificate on port 993
This command connects to the local IMAPS listener, supplies the appropriate Server Name Indication (SNI), and extracts the leaf certificate’s identifying information:
openssl s_client \
-connect 127.0.0.1:993 \
-servername mail.example.com \
</dev/null 2>/dev/null | \
openssl x509 -noout -subject -issuer -dates -serial
Following the reload, the actual validity period was:
notBefore=Dec 4 08:20:34 2026 GMT
notAfter=Mar 4 08:20:33 2027 GMT
The certificate serial number matched the replacement certificate reported by Certbot. This established a successful local presentation of the newly issued certificate. To compare against the certificate stored on disk:
sudo openssl x509 \
-in /etc/letsencrypt/live/mail.example.com/fullchain.pem \
-noout -subject -issuer -dates -serial -fingerprint -sha256
For a fingerprint comparison, add -fingerprint -sha256 to the live certificate extraction command as well. Matching serial numbers and SHA-256 fingerprints establish that the same leaf certificate is being presented.
8. Validate the chain and hostname independently
Inspecting the leaf certificate alone does not establish that the certificate chain is trusted or that hostname validation succeeds. Perform a stricter test:
openssl s_client \
-connect 127.0.0.1:993 \
-servername mail.example.com \
-verify_hostname mail.example.com \
-verify_return_error </dev/null
The desired verification result is Verify return code: 0 (ok). Repeat the test from an independent external system:
openssl s_client \
-connect mail.example.com:993 \
-servername mail.example.com \
-verify_hostname mail.example.com \
-verify_return_error </dev/null
External verification is particularly important where NAT, load balancers, proxies or multiple endpoints are involved. A local test establishes what the local Dovecot listener presents; an external test establishes what a client encounters on that network path. Full chain and hostname validation and post-remediation external connectivity were not documented in the incident evidence. These remain recommended acceptance tests, not completed findings.
9. Close the automation gap with a deployment hook
Certbot supports pre-hooks, post-hooks and deployment hooks. A deployment hook is the appropriate mechanism for reloading a consuming application after successful renewal. Before creating one, inspect the existing configuration:
sudo ls -la /etc/letsencrypt/renewal-hooks/deploy/
sudo grep -nE ‘hook’ /etc/letsencrypt/renewal/*.conf
sudo systemctl cat certbot-renew.service
The directory was empty on the affected gateway. That observation was consistent with a missing reload mechanism, although it did not rule out other hooks or external orchestration. Certbot versions before 3.2.0 restrict directory-based hooks to the renew subcommand; version 3.2.0 extends invocation to other applicable subcommands.
The following certificate-specific hook avoids reloading Dovecot when an unrelated certificate is renewed. Certbot supplies RENEWED_LINEAGE, identifying the renewed certificate’s live directory. Substitute the actual lineage shown by certbot certificates. On a dedicated gateway with a single certificate, an unconditional reload hook is also reasonable.
sudo -i
mkdir -p /etc/letsencrypt/renewal-hooks/deploy
cat > /etc/letsencrypt/renewal-hooks/deploy/90-dovecot.sh <<‘EOF’
#!/bin/sh
set -eu
CERT_LINEAGE=’/etc/letsencrypt/live/mail.example.com’
if [ “${RENEWED_LINEAGE:-}” = “$CERT_LINEAGE” ]; then
/usr/bin/systemctl reload dovecot.service
fi
EOF
chmod 755 /etc/letsencrypt/renewal-hooks/deploy/90-dovecot.sh
An explicit shebang makes execution semantics predictable rather than relying on shell fallback behavior. The set -eu directive makes unexpected command failures and unset-variable references fatal, while the parameter expansion safely handles an absent RENEWED_LINEAGE. The hook assumes Dovecot is configured to consume the specified lineage.
10. Test the deployment workflow
Execute the scoped hook manually, supplying the same lineage variable Certbot would provide:
sudo env \
RENEWED_LINEAGE=/etc/letsencrypt/live/mail.example.com \
/etc/letsencrypt/renewal-hooks/deploy/90-dovecot.sh
echo $?
The original, unconditional hook returned zero during manual testing on the affected server. The certificate-specific version above is an improved implementation, not a script independently tested on that production gateway.
Exercise the renewal and deployment workflow with a staging dry run:
sudo certbot renew –dry-run –run-deploy-hooks \
–cert-name mail.example.com
With –run-deploy-hooks, successful simulated renewal invokes the applicable deployment hooks using the active certificate rather than the temporary staging certificate. The production certificate is not replaced. Inspect the logs and repeat the live TLS checks afterward. The complete dry-run test was not documented as completed during the incident.
One subtle operational issue is that Certbot can exit successfully when no renewal is due, and a failed hook does not necessarily produce a nonzero Certbot exit status. A successful timer or renewal-service invocation is therefore not enough to establish successful deployment. Monitor hook failures and the live endpoint independently.
11. Account for every TLS termination point
A mail gateway may also run Postfix, Sendmail, webmail or reverse proxies using the same certificate. For Postfix, check whether the service is active and inspect its explicit TLS settings:
systemctl is-active postfix.service
sudo postconf -n | grep -E \
‘^(smtpd_tls_cert_file|smtpd_tls_key_file|smtpd_tls_chain_files)’
Also inspect master.cf service overrides where applicable. If Postfix uses the same certificate lineage, include its appropriate reload mechanism in the deployment workflow and independently validate the relevant SMTP endpoints. SMTP submission on port 587 generally uses STARTTLS, whereas port 465 uses implicit TLS; these require different OpenSSL test options. Do not assume that the IMAPS fix also corrected SMTP.
12. Monitor the certificate clients actually receive
Certificate monitoring should distinguish successful issuance, application deployment, endpoint presentation and trust validation. An expiration check against a PEM file on disk addresses only part of that lifecycle. For an unattended Bash-based endpoint check, use a bounded execution time and propagate pipeline errors:
#!/bin/bash
set -o pipefail
HOST=’mail.example.com’
PORT=993
MIN_VALIDITY=$((14 * 24 * 60 * 60))
timeout 15s openssl s_client \
-connect “${HOST}:${PORT}” \
-servername “$HOST” \
-verify_hostname “$HOST” \
-verify_return_error </dev/null | \
openssl x509 -noout -checkend “$MIN_VALIDITY”
This example checks the endpoint’s TLS connectivity, trust and hostname verification, and whether the leaf certificate expires within the configured interval. Bash’s pipefail propagates errors from either command. It does not test mailbox authentication or the complete IMAP workflow. Run endpoint checks from an independent monitoring location, and tune the threshold to the certificate lifetime, expected renewal window and remediation time. Fourteen days is an illustrative threshold, not a universal recommendation.
Monitor ACME renewal errors, deployment hook errors, certificate-chain and hostname failures, and discrepancies between the certificate on disk and the certificate presented externally. Where available, incorporate ARI and the expected renewal schedule into alerting logic.
Renewal is not lifecycle management
The incident illustrates a broader infrastructure management problem. Individual automation components can operate successfully without the system as a whole delivering the intended outcome. Certbot can renew a certificate, systemd can execute the renewal service as scheduled, and Dovecot can remain active while users still encounter a certificate warning.
The operational implications are becoming more urgent as certificate lifetimes shorten. Let’s Encrypt has announced a staged transition of its default certificate lifetime toward 45 days. More frequent issuance and deployment operations leave less room for unnoticed failures, making reliable orchestration and endpoint monitoring increasingly important.
A certificate is not operationally renewed just because a new PEM file exists on disk. The lifecycle is complete when the intended service presents the replacement certificate and connecting clients can validate it successfully.
Everything else is intermediat, or in Fed speak, “transitory”.
Beyond Certificate Renewal: The Shadow of Q-Day
Even when the entire certificate lifecycle works flawlessly, a more fundamental question remains: How secure is the cryptographic exchange itself?
Long before Q-Day—the point at which a cryptographically relevant quantum computer becomes capable of breaking widely deployed public-key cryptography—the long-term confidentiality of today’s communications is already at stake. Adversaries can intercept and retain encrypted network traffic with the intention of decrypting it once sufficiently powerful quantum computers become available. This threat, known as harvest now, decrypt later (HNDL), exposes the limitations of TLS connections that rely exclusively on quantum-vulnerable key establishment, even when conventional forward secrecy is in place.
The transition to post-quantum and hybrid cryptographic mechanisms introduces yet another dimension to automated TLS management. Infrastructure operators must ultimately ensure not only that certificates are renewed, deployed, and validated correctly, but also that the underlying cryptographic mechanisms remain appropriate for the anticipated confidentiality lifetime of the information they protect. Post-quantum key establishment and post-quantum certificate authentication address distinct security requirements; upgrading one does not automatically upgrade the other.
A certificate can be perfectly valid while the cryptographic assumptions underpinning the connection are approaching their expiration date. Unlike a TLS certificate, however, those assumptions come with no expiration timestamp.
Leave a Reply