Commit 3bea9d5e authored by Natanael Copa's avatar Natanael Copa
Browse files

main/dovecot: enable ssl and create self-signed cert on install

fixes #667
parent 9182e0aa
......@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dovecot
pkgver=2.0.14
pkgrel=0
pkgrel=1
pkgdesc="IMAP and POP3 server"
url="http://www.dovecot.org/"
arch="all"
......@@ -62,11 +62,15 @@ package() {
"$pkgdir"/etc/dovecot/dovecot.conf || return 1
mkdir -p "$pkgdir"/etc/dovecot/conf.d
# fix ssl dirs in defautl config and set defautl passdb to passwd
# fix ssl dirs in default config and set defautl passdb to passwd
sed -i -e 's,^ssl_cert =.*,ssl_cert = </etc/ssl/dovecot/server.pem,' \
-e 's,^ssl_key =.*,ssl_key = </etc/ssl/dovecot/server.key,' \
"$pkgdir"/usr/share/doc/dovecot/example-config/conf.d/10-ssl.conf\
|| return 1
# install ssl config by default
cp "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d/10-ssl.conf\
"$pkgdir"/etc/dovecot/conf.d/ || return 1
}
_mv() {
......
......@@ -3,7 +3,7 @@
# based on doc/mkcert.sh
# if ssl disabled then lets just exit
doveconf ssl | grep -q 'yes' || exit 0
doveconf ssl 2>/dev/null | grep -q 'yes' || exit 0
# Generates a self-signed certificate.
OPENSSL=${OPENSSL-openssl}
......@@ -25,7 +25,7 @@ fi
# 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_cert 2>/dev/null)" ] && exit 0
[ -n "$(doveconf -x ssl_key 2>/dev/null)" ] && exit 0
[ -z "$ssl_cert_file" ] && ssl_cert_file=$(doveconf ssl_cert | sed 's/.*= <//')
[ -z "$ssl_key_file" ] && ssl_key_file=$(doveconf ssl_key | sed 's/.*= <//')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment