From ed2e5d142804bd69d296c39c6b861b8401718469 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Wed, 6 May 2020 00:53:22 +0000 Subject: user/dovecot: review fixes - move default SSL key and cert stuff to a patch - use auth-system.conf instead of auth-passwdfile.conf because we have PAM - explain manual removal of *.la - other Adelification fixes --- user/dovecot/dovecot.post-install | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 user/dovecot/dovecot.post-install (limited to 'user/dovecot/dovecot.post-install') diff --git a/user/dovecot/dovecot.post-install b/user/dovecot/dovecot.post-install new file mode 100644 index 000000000..eb70cdece --- /dev/null +++ b/user/dovecot/dovecot.post-install @@ -0,0 +1,45 @@ +#!/bin/sh + +# based on doc/mkcert.sh + +# if ssl disabled then lets just exit +doveconf ssl 2>/dev/null | grep -Eq '(yes|required)' || exit 0 +# Generates a self-signed certificate. + +OPENSSL=${OPENSSL-openssl} +SSLDIR=${SSLDIR-/etc/ssl/dovecot} +OPENSSLCONFIG=${OPENSSLCONFIG-/etc/dovecot/dovecot-openssl.cnf} + +CERTDIR=$SSLDIR +KEYDIR=$SSLDIR + +# check if we have ssl_cert and/or key (for dovecot-2.0+) +# try expand the cert/key itself and if found, lets just keep it +[ -n "$(doveconf -x ssl_cert 2>/dev/null)" ] && exit 0 +[ -n "$(doveconf -x ssl_key 2>/dev/null)" ] && exit 0 + +ssl_cert_file=$(doveconf ssl_cert | sed 's/.*=