- # if we already have it installed, need to reconfigure, without being prompted
- if dpkg -s exim4-config &>/dev/null; then
- # gotta remove this, otherwise the set-selections are completely
- # ignored. It woulda been nice if this was documented somewhere!
- s rm -f /etc/exim4/update-exim4.conf.conf
- s dpkg-reconfigure -u -fnoninteractive exim4-config
- fi
- # light version does not have sasl auth support.
- pi exim4-daemon-heavy spamassassin
-
- ##### begin spamassassin config
- ser enable spamassassin
- # per readme.debian
- s sed -i '/^\s*CRON\s*=/d' /etc/default/spamassassin
- s tee -a /etc/default/spamassassin <<<CRON=1
- # just noticed this in the config file, seems like a good idea.
- s sed -i '/^\s*NICE\s*=/d' /etc/default/spamassassin
- s tee -a /etc/default/spamassassin <<<'NICE="--nicelevel 15"'
- ser reload spamassassin
-
- s dd of=/etc/systemd/system/spamddnsfix.service <<'EOF'
+ echo | /a/exe/cedit mail /etc/dnsmasq-servers.conf || [[ $? == 1 ]]
+ systemctl reload dnsmasq
+
+ systemctl disable mailclean.timer &>/dev/null ||:
+ systemctl stop mailclean.timer &>/dev/null ||:
+ systemctl disable $vpn_ser@mail
+ systemctl stop $vpn_ser@mail
+ systemctl disable dovecot ||:
+ systemctl stop dovecot ||:
+ #
+ #
+ # would only exist because I wrote it i the previous condition,
+ # it\'s not part of exim
+ rm -f /etc/exim4/conf.d/main/000_localmacros
+ cat >>/etc/exim4/update-exim4.conf.conf <<EOF
+dc_eximconfig_configtype='satellite'
+dc_smarthost='$smarthost'
+dc_readhost='$(hostname -f)'
+# i dunno if this would ever get used.
+dc_localdelivery='maildir_home'
+dc_hide_mailname=''
+EOF
+
+ hostname -f > /etc/mailname
+
+fi # end $HOSTNAME != $MAIL_HOST
+
+systemctl reload exim4
+
+# i have the spool directory be common to distro multi-boot, so
+# we need the uid to be the same. 608 cuz it's kind of in the middle
+# of the free system uids.
+IFS=:; read _ _ uid _ < <(getent passwd Debian-exim ||:) ||:; unset IFS
+IFS=:; read _ _ gid _ < <(getent group Debian-exim ||:) ||:; unset IFS
+if [[ ! $uid ]]; then
+ # from /var/lib/dpkg/info/exim4-base.postinst, plus uid and gid options
+ adduser --uid 608 --system --group --quiet --home /var/spool/exim4 \
+ --no-create-home --disabled-login --force-badname Debian-exim
+elif [[ $uid != 608 ]]; then
+ systemctl stop exim4 ||:
+ usermod -u 608 Debian-exim
+ groupmod -g 608 Debian-exim
+ usermod -g 608 Debian-exim
+ find / /nocow -xdev -uid $uid -exec chown -h 608 {} +
+ find / /nocow -xdev -gid $gid -exec chgrp -h 608 {} +
+fi
+
+
+# light version of exim does not have sasl auth support.
+pi exim4-daemon-heavy spamassassin spf-tools-perl
+
+
+
+##### begin spamassassin config
+systemctl enable spamassassin
+# per readme.debian
+sed -i '/^\s*CRON\s*=/d' /etc/default/spamassassin
+e CRON=1 >>/etc/default/spamassassin
+# just noticed this in the config file, seems like a good idea.
+sed -i '/^\s*NICE\s*=/d' /etc/default/spamassassin
+e 'NICE="--nicelevel 15"' >>/etc/default/spamassassin
+systemctl start spamassassin
+systemctl reload spamassassin
+
+cat >/etc/systemd/system/spamddnsfix.service <<'EOF'