Commit 6742f102 authored by Paul Cammish's avatar Paul Cammish
Browse files

Merge branch 'dovecot-sni_reload' into 'buster-testing'

Dovecot sni reload

See merge request sympl/sympl!76
parents 07736872 5d88bab4
sympl-mail (10.0.190702.1) stable; urgency=medium
sympl-mail (10.0.190706.0) stable; urgency=medium
* Updated sympl-mail-dovecot-sni for edge cases
* Improved sympl-mail ssl-hook
-- Paul Cammish <sympl@kelduum.net> Sun, 06 Jul 2019 18:51:42 +0100
sympl-mail (10.0.190702.1) stable; urgency=medium
* Adjusted exim config group
......
......@@ -16,13 +16,20 @@ if echo "ae779d6822f91492b26697d6b9931835 /etc/default/clamav-daemon" | md5sum
rm -f /etc/default/clamav-daemon
fi
#
# Remove the old diversion
#
# Remove the old Dovecot SNI config if it exists
#
if [ -f /etc/dovecot/sympl.d/10-main/60-sni ]; then
rm /etc/dovecot/sympl.d/10-main/60-sni
fi
#
# Remove the old diversion
#
package="sympl-mail"
conf="/etc/dovecot/dovecot.conf"
#
#
# Dovecot ships with its own config.
#
package="sympl-mail"
......@@ -46,5 +53,6 @@ if dpkg-divert --list "$package" | grep -xFq "diversion of $conf to $theirfile b
fi
#DEBHELPER#
exit 0
......@@ -2,6 +2,25 @@
set -e
if [ ! -L /srv/*/config/ssl/current ]; then
# No certs avaialable, so check if /etc/dovecot/sympl.d/10-main/60-sni exists
if [ -f /etc/dovecot/sympl.d/10-main/60-sni ]; then
# it exists, so remove it
rm /etc/dovecot/sympl.d/10-main/60-sni
# then rebuild the configuration if theres a Makefile (ie: sympl-mail is installed)
if [ -f /etc/dovecot/Makefile ]; then
cd /etc/dovecot
sudo /usr/bin/make test
sudo /usr/bin/make > /dev/null
sudo /usr/sbin/service dovecot reload
fi
exit 0
else
# Nothing to do yet, so just exit.
exit 0
fi
fi
for certificate in $( find -L /srv/*/config/ssl/current -name 'ssl.crt' -print ); do
certpath="$( echo $certificate | sed 's|/config/ssl/current/.*$|/config/ssl/current|' )"
# Ensure there is a matching key file, and the path doesnt include an underscore
......@@ -36,13 +55,16 @@ if [ -f "/etc/dovecot/sympl.d/10-main/60-sni" ]; then
fi
fi
# Move the new config into place, make it and start it up
# Move the new config into place...
mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni
cd /etc/dovecot
sudo make test
sudo make > /dev/null
sudo /usr/sbin/service dovecot reload
# ... and build the new config if the Makefile is in place.
if [ -f /etc/dovecot/Makefile ]; then
cd /etc/dovecot
sudo /usr/bin/make test
sudo /usr/bin/make > /dev/null
sudo /usr/sbin/service dovecot reload
fi
if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi
......
......@@ -8,4 +8,5 @@ fi
#
# Rebuild Dovecot SNI Certificates and reload on cert change.
#
sudo /usr/sbin/sympl-mail-dovecot-sni
/usr/sbin/sympl-mail-dovecot-sni
/usr/sbin/service dovecot reload
\ No newline at end of file
Supports Markdown
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