if ! grep -q ^ssl_cert /etc/dovecot/conf.d/10-ssl.conf \
&& ! grep -q ^ssl_key /etc/dovecot/conf.d/10-ssl.conf; then
- echo "CN: Generating certificate and key..."
- /usr/share/dovecot-cn/mkcert.sh > /dev/null
+ if [ ! -f /etc/dovecot/dovecot.pem -a ! -f /etc/dovecot/private/dovecot.pem ]; then
+ echo "CN: Generating certificate and key..."
+ /usr/share/dovecot-cn/mkcert.sh 2>&1 > /dev/null
+ fi
cp_check_and_sed '#ssl_cert = </etc/dovecot/dovecot.pem' \
's|#ssl_cert = </etc/dovecot/dovecot.pem|ssl_cert = </etc/dovecot/dovecot.pem|g' \