X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=573078841cf8072127002fa4143d377e0077c061;hb=cca99b5a9d3cf311585a9c37b39698b0febe417c;hp=0c543863e777a5bc12f73604579a0672bd80f6c8;hpb=32fb94de4f6b8e30ee53486f87721e73ed4eff50;p=distro-setup diff --git a/mail-setup b/mail-setup index 0c54386..5730788 100755 --- a/mail-setup +++ b/mail-setup @@ -15,6 +15,8 @@ set -x # See the License for the specific language governing permissions and # limitations under the License. +# todo: make quick backups of maildir, or deliver to multiple hosts. + set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR @@ -243,7 +245,7 @@ if postfix; then if command -v apt-get &> /dev/null; then debconf-set-selections < /etc/mailname + # MAIN_HARDCODE_PRIMARY_HOSTNAME might mess up the # smarthost config type, not sure. all other settings # would be unused in that config type. @@ -698,6 +703,19 @@ ssl_prefer_server_ciphers = yes EOF ####### end dovecot setup ######## + # https://selivan.github.io/2017/12/30/systemd-serice-always-restart.html + d=/etc/systemd/system/openvpn@mail + mkdir -p $d + cat >$d/override.conf <<'EOF' +[Service] +Restart=always +# time to sleep before restarting a service +RestartSec=1 + +[Unit] +# StartLimitIntervalSec in recent systemd versions +StartLimitInterval=0 +EOF systemctl enable offlineimapsync.timer systemctl start offlineimapsync.timer @@ -721,10 +739,13 @@ EOF debconf-set-selections < /etc/mailname fi # end $HOSTNAME != $MAIL_HOST