From f38436a8de31b613c5a78ebe93b39c28a2508540 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Fri, 5 Jul 2019 00:47:25 +0100 Subject: [PATCH 01/18] Update sympl-mail-dovecot-sni to always reload doevcot --- mail/sbin/sympl-mail-dovecot-sni | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 67befcf6..11467540 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -31,6 +31,7 @@ done >> /dev/shm/sympl-mail-dovecot-sni.config # Compare it with what's there already. if [ -f "/etc/dovecot/sympl.d/10-main/60-sni" ]; then if diff /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni > /dev/null ; then + /usr/sbin/service dovecot reload # Config has not changed, exiting. exit 0 fi @@ -39,10 +40,10 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -sudo make test +make test -sudo make > /dev/null -sudo /usr/sbin/service dovecot reload +make > /dev/null +/usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From 59e07e0a582bb8b9bfa710e9943fcdece72a887e Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Fri, 5 Jul 2019 00:48:30 +0100 Subject: [PATCH 02/18] Update sympl-mail --- mail/sympl/ssl-hooks.d/sympl-mail | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mail/sympl/ssl-hooks.d/sympl-mail b/mail/sympl/ssl-hooks.d/sympl-mail index fc25abf4..1c9e08e6 100755 --- a/mail/sympl/ssl-hooks.d/sympl-mail +++ b/mail/sympl/ssl-hooks.d/sympl-mail @@ -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 -- GitLab From 975ebaebd384eae51a76cf9617137de1f1c74211 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Fri, 5 Jul 2019 00:49:03 +0100 Subject: [PATCH 03/18] Revert "Update sympl-mail-dovecot-sni to always reload doevcot" This reverts commit f38436a8de31b613c5a78ebe93b39c28a2508540 --- mail/sbin/sympl-mail-dovecot-sni | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 11467540..67befcf6 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -31,7 +31,6 @@ done >> /dev/shm/sympl-mail-dovecot-sni.config # Compare it with what's there already. if [ -f "/etc/dovecot/sympl.d/10-main/60-sni" ]; then if diff /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni > /dev/null ; then - /usr/sbin/service dovecot reload # Config has not changed, exiting. exit 0 fi @@ -40,10 +39,10 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -make test +sudo make test -make > /dev/null -/usr/sbin/service dovecot reload +sudo make > /dev/null +sudo /usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From 526228532df3f572eb239f6936768310f5305db0 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 16:19:38 +0100 Subject: [PATCH 04/18] Remove SNI config file when uninstalling --- mail/debian/prerm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mail/debian/prerm b/mail/debian/prerm index 4d02900f..5bed295c 100755 --- a/mail/debian/prerm +++ b/mail/debian/prerm @@ -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 -- GitLab From c2db01867421f7ab7828cbdec4a464252eff7ffe Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 16:19:51 +0100 Subject: [PATCH 05/18] Only run if there are certs available --- mail/sbin/sympl-mail-dovecot-sni | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 67befcf6..0299a279 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -2,6 +2,23 @@ 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 + cd /etc/dovecot + make test + make > /dev/null + /usr/sbin/service dovecot reload + 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 @@ -39,10 +56,10 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -sudo make test +make test -sudo make > /dev/null -sudo /usr/sbin/service dovecot reload +make > /dev/null +/usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From b3273eb91a9517283a5bc107a31987f3dc8a78a3 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 18:45:24 +0100 Subject: [PATCH 06/18] Update sympl-mail-dovecot-sni --- mail/sbin/sympl-mail-dovecot-sni | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 0299a279..09a23f77 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -9,8 +9,8 @@ if [ ! -L /srv/*/config/ssl/current ]; then rm /etc/dovecot/sympl.d/10-main/60-sni # then rebuild the configuration cd /etc/dovecot - make test - make > /dev/null + /usr/bin/make test + /usr/bin/make > /dev/null /usr/sbin/service dovecot reload exit 0 else @@ -56,9 +56,8 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -make test - -make > /dev/null +/usr/bin/make test +/usr/bin/make > /dev/null /usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From e549d923b48be9681702e291bd64762fbc0f1597 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 18:47:34 +0100 Subject: [PATCH 07/18] Update changelog --- mail/debian/changelog | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mail/debian/changelog b/mail/debian/changelog index 612a4ba4..b70dd1ce 100644 --- a/mail/debian/changelog +++ b/mail/debian/changelog @@ -1,4 +1,11 @@ -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 Sun, 06 Jul 2019 18:51:42 +0100 + + sympl-mail (10.0.190702.1) stable; urgency=medium * Adjusted exim config group -- GitLab From e284d04b96ce891ea1f5f746942da6d7d83c3102 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 19:00:55 +0100 Subject: [PATCH 08/18] Update sympl-mail-dovecot-sni --- mail/sbin/sympl-mail-dovecot-sni | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 09a23f77..88859970 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -9,9 +9,9 @@ if [ ! -L /srv/*/config/ssl/current ]; then rm /etc/dovecot/sympl.d/10-main/60-sni # then rebuild the configuration cd /etc/dovecot - /usr/bin/make test - /usr/bin/make > /dev/null - /usr/sbin/service dovecot reload + sudo /usr/bin/make test + sudo /usr/bin/make > /dev/null + sudo /usr/sbin/service dovecot reload exit 0 else # Nothing to do yet, so just exit. @@ -56,9 +56,9 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -/usr/bin/make test -/usr/bin/make > /dev/null -/usr/sbin/service dovecot reload +sudo /usr/bin/make test +sudo /usr/bin/make > /dev/null +sudo /usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From 78b0eee6c40f8e22a3d721cb6f20f942941794fb Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 19:36:42 +0100 Subject: [PATCH 09/18] Update sympl-mail-dovecot-sni --- mail/sbin/sympl-mail-dovecot-sni | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 88859970..7f332e62 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -7,11 +7,13 @@ if [ ! -L /srv/*/config/ssl/current ]; then 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 - cd /etc/dovecot - sudo /usr/bin/make test - sudo /usr/bin/make > /dev/null - sudo /usr/sbin/service dovecot reload + # 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. @@ -53,12 +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 /usr/bin/make test -sudo /usr/bin/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 -- GitLab From eb58235452d000defd3aeac2aa3633b3c96fc3c2 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Fri, 5 Jul 2019 00:47:25 +0100 Subject: [PATCH 10/18] Update sympl-mail-dovecot-sni to always reload doevcot --- mail/sbin/sympl-mail-dovecot-sni | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 67befcf6..11467540 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -31,6 +31,7 @@ done >> /dev/shm/sympl-mail-dovecot-sni.config # Compare it with what's there already. if [ -f "/etc/dovecot/sympl.d/10-main/60-sni" ]; then if diff /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni > /dev/null ; then + /usr/sbin/service dovecot reload # Config has not changed, exiting. exit 0 fi @@ -39,10 +40,10 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -sudo make test +make test -sudo make > /dev/null -sudo /usr/sbin/service dovecot reload +make > /dev/null +/usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From 0e97343a504b588a269d17ee4f64195fd7d57115 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Fri, 5 Jul 2019 00:48:30 +0100 Subject: [PATCH 11/18] Update sympl-mail --- mail/sympl/ssl-hooks.d/sympl-mail | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mail/sympl/ssl-hooks.d/sympl-mail b/mail/sympl/ssl-hooks.d/sympl-mail index fc25abf4..1c9e08e6 100755 --- a/mail/sympl/ssl-hooks.d/sympl-mail +++ b/mail/sympl/ssl-hooks.d/sympl-mail @@ -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 -- GitLab From c0d25c0caf0657f9ffd998d0f2d18dd68a0f1e04 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Fri, 5 Jul 2019 00:49:03 +0100 Subject: [PATCH 12/18] Revert "Update sympl-mail-dovecot-sni to always reload doevcot" This reverts commit f38436a8de31b613c5a78ebe93b39c28a2508540 --- mail/sbin/sympl-mail-dovecot-sni | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 11467540..67befcf6 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -31,7 +31,6 @@ done >> /dev/shm/sympl-mail-dovecot-sni.config # Compare it with what's there already. if [ -f "/etc/dovecot/sympl.d/10-main/60-sni" ]; then if diff /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni > /dev/null ; then - /usr/sbin/service dovecot reload # Config has not changed, exiting. exit 0 fi @@ -40,10 +39,10 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -make test +sudo make test -make > /dev/null -/usr/sbin/service dovecot reload +sudo make > /dev/null +sudo /usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From e905e83e6090892116fa6f888c79778872854473 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 16:19:38 +0100 Subject: [PATCH 13/18] Remove SNI config file when uninstalling --- mail/debian/prerm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mail/debian/prerm b/mail/debian/prerm index 4d02900f..5bed295c 100755 --- a/mail/debian/prerm +++ b/mail/debian/prerm @@ -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 -- GitLab From 8864a9b347521f2d28b91f4967bba1214973799d Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 16:19:51 +0100 Subject: [PATCH 14/18] Only run if there are certs available --- mail/sbin/sympl-mail-dovecot-sni | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 67befcf6..0299a279 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -2,6 +2,23 @@ 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 + cd /etc/dovecot + make test + make > /dev/null + /usr/sbin/service dovecot reload + 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 @@ -39,10 +56,10 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -sudo make test +make test -sudo make > /dev/null -sudo /usr/sbin/service dovecot reload +make > /dev/null +/usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From 5d4e899f106565a80f27b3738c0093f8b165f38c Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 18:45:24 +0100 Subject: [PATCH 15/18] Update sympl-mail-dovecot-sni --- mail/sbin/sympl-mail-dovecot-sni | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 0299a279..09a23f77 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -9,8 +9,8 @@ if [ ! -L /srv/*/config/ssl/current ]; then rm /etc/dovecot/sympl.d/10-main/60-sni # then rebuild the configuration cd /etc/dovecot - make test - make > /dev/null + /usr/bin/make test + /usr/bin/make > /dev/null /usr/sbin/service dovecot reload exit 0 else @@ -56,9 +56,8 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -make test - -make > /dev/null +/usr/bin/make test +/usr/bin/make > /dev/null /usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From 7d4f0bdce35289ba14744544e9548879fd862b17 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 18:47:34 +0100 Subject: [PATCH 16/18] Update changelog --- mail/debian/changelog | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mail/debian/changelog b/mail/debian/changelog index 612a4ba4..b70dd1ce 100644 --- a/mail/debian/changelog +++ b/mail/debian/changelog @@ -1,4 +1,11 @@ -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 Sun, 06 Jul 2019 18:51:42 +0100 + + sympl-mail (10.0.190702.1) stable; urgency=medium * Adjusted exim config group -- GitLab From 01a0535bae742dbafde2541998038bfe50ea1f1b Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 19:00:55 +0100 Subject: [PATCH 17/18] Update sympl-mail-dovecot-sni --- mail/sbin/sympl-mail-dovecot-sni | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 09a23f77..88859970 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -9,9 +9,9 @@ if [ ! -L /srv/*/config/ssl/current ]; then rm /etc/dovecot/sympl.d/10-main/60-sni # then rebuild the configuration cd /etc/dovecot - /usr/bin/make test - /usr/bin/make > /dev/null - /usr/sbin/service dovecot reload + sudo /usr/bin/make test + sudo /usr/bin/make > /dev/null + sudo /usr/sbin/service dovecot reload exit 0 else # Nothing to do yet, so just exit. @@ -56,9 +56,9 @@ fi # Move the new config into place, make it and start it up mv /dev/shm/sympl-mail-dovecot-sni.config /etc/dovecot/sympl.d/10-main/60-sni cd /etc/dovecot -/usr/bin/make test -/usr/bin/make > /dev/null -/usr/sbin/service dovecot reload +sudo /usr/bin/make test +sudo /usr/bin/make > /dev/null +sudo /usr/sbin/service dovecot reload if [ -f /dev/shm/sympl-mail-dovecot-sni.data ]; then rm /dev/shm/sympl-mail-dovecot-sni.data; fi -- GitLab From c704e3451a26d125338f6f55fd496b84ba6b8e1f Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Sat, 6 Jul 2019 19:36:42 +0100 Subject: [PATCH 18/18] Update sympl-mail-dovecot-sni --- mail/sbin/sympl-mail-dovecot-sni | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mail/sbin/sympl-mail-dovecot-sni b/mail/sbin/sympl-mail-dovecot-sni index 88859970..7f332e62 100755 --- a/mail/sbin/sympl-mail-dovecot-sni +++ b/mail/sbin/sympl-mail-dovecot-sni @@ -7,11 +7,13 @@ if [ ! -L /srv/*/config/ssl/current ]; then 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 - cd /etc/dovecot - sudo /usr/bin/make test - sudo /usr/bin/make > /dev/null - sudo /usr/sbin/service dovecot reload + # 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. @@ -53,12 +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 /usr/bin/make test -sudo /usr/bin/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 -- GitLab