From 0ca31b91fec461793f8166a938e2397904d17993 Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Thu, 30 Nov 2023 10:11:05 +0100 Subject: [PATCH] fix(certbot): Fix hook for dovecot (too strict) When we use a separate certificate for POP3 and IMAP there might be blank characters (almost certainly spaces but might as well be more lax) before `ssl_cert` which resulted in these lines not being detected and the hook not being played, forcing manual intervention. This commit fixes that problem by accepting blank characters before ssl_certs. (`\b` might be even better...) --- CHANGELOG.md | 1 + certbot/files/hooks/deploy/dovecot.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6418cb..60fb6f2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ The **patch** part changes is incremented if multiple releases happen the same m * webapps/nextcloud: fix misplaced gid attribute * webapps/nextcloud: fix missing gid * check stat.exists before stat.isdir +* certbot: Fix hook for dovecot when more than one certificate is used (eg. different certificates for POP3 and IMAP) ### Removed diff --git a/certbot/files/hooks/deploy/dovecot.sh b/certbot/files/hooks/deploy/dovecot.sh index 56e5b5ae..1ed4ab5d 100644 --- a/certbot/files/hooks/deploy/dovecot.sh +++ b/certbot/files/hooks/deploy/dovecot.sh @@ -16,7 +16,7 @@ config_check() { ${doveconf_bin} > /dev/null 2>&1 } letsencrypt_used() { - ${doveconf_bin} | grep -E "^ssl_cert[^_]" | grep -q "letsencrypt" + ${doveconf_bin} | grep -E "^[[:blank:]]*ssl_cert[^_]" | grep -q "letsencrypt" } main() { if daemon_found_and_running; then