Making another attempt to deal with the ssl issue

This commit is contained in:
Robert Hafner 2013-12-05 15:29:04 -08:00
parent aab81066cc
commit e8477204a3
2 changed files with 35 additions and 5 deletions

View File

@ -5,11 +5,7 @@ if [ -n "$TRAVIS" ]; then
echo 'Travis config not yet written' echo 'Travis config not yet written'
sudo cp -Rp $TRAVIS_BUILD_DIR/tests/resources /resources sudo cp -Rp $TRAVIS_BUILD_DIR/tests/resources /resources
sudo /bin/bash /resources/Scripts/Provision.sh sudo /bin/bash /resources/Scripts/Provision.sh
sudo stop dovecot sudo /bin/bash /resources/Scripts/SSL.sh
sudo cp -p /resources/dovecot.pem /etc/ssl/private/
sudo chgrp dovecot /etc/ssl/private/dovecot.pem
sudo start dovecot
else else

View File

@ -0,0 +1,34 @@
#!/bin/sh
stop dovecot
STARTPATH=`pwd`
SSL_CERT=/etc/ssl/certs/dovecot.pem
SSL_KEY=/etc/ssl/private/dovecot.pem
echo "Creating generic self-signed certificate: $SSL_CERT"
cd /etc/ssl/certs
PATH=$PATH:/usr/bin/ssl
FQDN=`hostname -f`
MAILNAME=`cat /etc/mailname 2> /dev/null || hostname -f`
(openssl req -new -x509 -days 365 -nodes -out $SSL_CERT -keyout $SSL_KEY > /dev/null 2>&1 <<+
.
.
.
Dovecot mail server
$FQDN
$FQDN
root@$MAILNAME
+
) || echo "Warning : Bad SSL config, can't generate certificate."
chown root $SSL_CERT || true
chgrp dovecot $SSL_CERT || true
chmod 0644 $SSL_CERT || true
chown root $SSL_KEY || true
chgrp dovecot $SSL_KEY || true
chmod 0600 $SSL_KEY || true
start dovecot