X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=b28bedf004b895d497ccb3c98c2f61f602947fab;hb=efcfe83c7df501547696e38d822232e67b94644f;hp=dbdf8fa44cdb307624cdfefadad9133c45720ebf;hpb=6f1f8a104c9b38936ade2d27e835479523985133;p=distro-setup diff --git a/mail-setup b/mail-setup index dbdf8fa..b28bedf 100755 --- a/mail-setup +++ b/mail-setup @@ -168,7 +168,7 @@ smarthost="$mxhost::$mxport" ## * Install packages # light version of exim does not have sasl auth support. -pi exim4-daemon-heavy spamassassin spf-tools-perl openvpn dnsmasq +pi exim4-daemon-heavy spamassassin spf-tools-perl openvpn # trisquel 8 = openvpn, debian stretch = openvpn-client vpn_ser=openvpn-client @@ -624,7 +624,9 @@ EOF /a/exe/cedit mail /etc/dnsmasq-servers.conf <<'EOF' || [[ $? == 1 ]] server=/mail.iankelling.org/127.0.1.1 EOF - systemctl reload dnsmasq + if systemctl is-active dnsmasq >/dev/null; then + systemctl reload dnsmasq + fi # I used to use debconf-set-selections + dpkg-reconfigure, # which then updates this file @@ -777,7 +779,9 @@ s#^(127\.0\.1\.1 .*)mail\.iankelling\.org +(.*)#\1\2# EOF echo | /a/exe/cedit mail /etc/dnsmasq-servers.conf || [[ $? == 1 ]] - systemctl reload dnsmasq + if systemctl is-active dnsmasq >/dev/null; then + systemctl reload dnsmasq + fi systemctl disable mailclean.timer &>/dev/null ||: systemctl stop mailclean.timer &>/dev/null ||: @@ -802,10 +806,10 @@ EOF hostname -f > /etc/mailname - # We set this to alerts on MAIL_HOST, but using a user that doesn't exist elsewhere + # This ends up at alerts mailbox on MAIL_HOST, but using a user that doesn't exist elsewhere # is no good. sed -i --follow-symlinks -f - /etc/aliases </dev/null; then + systemctl reload exim4 +else + systemctl start exim4 +fi # * mail monitoring / testing