[debian-edu-commits] debian-edu/ 01/01: Add forgotten file. Thanks to jenkins.debian.net.
Wolfgang Schweer
schweer-guest at moszumanska.debian.org
Sat Dec 6 00:21:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
schweer-guest pushed a commit to branch master
in repository debian-edu-config.
commit beb510ec5d0ac23b70d37489884505c401e3c246
Author: Wolfgang Schweer <wschweer at arcor.de>
Date: Sat Dec 6 01:19:52 2014 +0100
Add forgotten file. Thanks to jenkins.debian.net.
---
.../tools/debian-edu-dovecot-create-cert | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/share/debian-edu-config/tools/debian-edu-dovecot-create-cert b/share/debian-edu-config/tools/debian-edu-dovecot-create-cert
new file mode 100755
index 0000000..37b95de
--- /dev/null
+++ b/share/debian-edu-config/tools/debian-edu-dovecot-create-cert
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# Create a self-signed certificate for dovecot.
+# Based upon a script from debian-lan-config by Andreas B. Mundt.
+#
+
+set -e
+
+TEMPLATE="/usr/share/ssl-cert/ssleay.cnf"
+HostName="postoffice.intern"
+
+## Create dovecot certificate:
+CERT="/etc/dovecot/dovecot.pem"
+KEY="/etc/dovecot/private/dovecot.pem"
+CONF="/etc/dovecot/dovecot.cnf"
+
+if [ ! -f $CONF ] ; then
+ sed -e s#@HostName@#"$HostName"# $TEMPLATE > $CONF
+ echo "subjectAltName=DNS:$HostName,DNS:postoffice.intern" >> $CONF
+ openssl req -config $CONF -new -x509 -days 7000 -nodes -out $CERT -keyout $KEY
+ chmod 640 $KEY $CERT $CONF
+ chown root:dovecot $KEY $CERT
+ ## Switch on SSL:
+ sed -i -e "s/^ssl = no/ssl = yes/" \
+ -e "s/^#ssl_cert =/ssl_cert =/" \
+ -e "s/^#ssl_key =/ssl_key =/" /etc/dovecot/conf.d/10-ssl.conf
+else
+ echo "$CONF exists, nothing done!"
+fi
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git
More information about the debian-edu-commits
mailing list