summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-09-06 06:44:18 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-09-06 06:44:18 +0000
commit3bea9d5e13f8f936fdc61aca3c65b4959ee02fb6 (patch)
tree82ee0486779e0833efbabe865dd7a53729d354e0 /main
parent9182e0aaa8525bdd3e3fcb81f3b1a1243ec8014c (diff)
downloadaports-3bea9d5e13f8f936fdc61aca3c65b4959ee02fb6.tar.bz2
aports-3bea9d5e13f8f936fdc61aca3c65b4959ee02fb6.tar.xz
main/dovecot: enable ssl and create self-signed cert on install
fixes #667
Diffstat (limited to 'main')
-rw-r--r--main/dovecot/APKBUILD8
-rw-r--r--main/dovecot/dovecot.post-install4
2 files changed, 8 insertions, 4 deletions
diff --git a/main/dovecot/APKBUILD b/main/dovecot/APKBUILD
index 83e4338d8..7a42614e6 100644
--- a/main/dovecot/APKBUILD
+++ b/main/dovecot/APKBUILD
@@ -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() {
diff --git a/main/dovecot/dovecot.post-install b/main/dovecot/dovecot.post-install
index e4d6bb281..c014fcbb4 100644
--- a/main/dovecot/dovecot.post-install
+++ b/main/dovecot/dovecot.post-install
@@ -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/.*= <//')