- rm -f /etc/exim4/conf.d/main/000_localmacros
- debconf-set-selections <<EOF
-exim4-config exim4/dc_eximconfig_configtype select mail sent by smarthost; no local mail
-exim4-config exim4/dc_smarthost string $smarthost
-# afaik, on dpkg-reconfigure noninteractive, this sets /etc/mailname if it does not exist.
-# if it does exist, it immediately changes the value to whats in /etc/mailname.
-# So, I don't think there's any point in setting it, but might as well since
-# ignoring what I set here is brain dead and might change.
-exim4-config exim4/mailname string $(hostname -f)
-EOF
- hostname -f > /etc/mailname
-
-fi # end $HOSTNAME != $MAIL_HOST
-
-# 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!
- rm -f /etc/exim4/update-exim4.conf.conf
- while fuser /var/lib/dpkg/lock &>/dev/null; do sleep 1; done
- dpkg-reconfigure -u -fnoninteractive exim4-config
-fi
-
-# 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'
-[Unit]
-Description=spamd dns bug fix cronjob
-
-[Service]
-Type=oneshot
-ExecStart=/a/bin/distro-setup/spamd-dns-fix
+ rm -fv /etc/exim4/conf.d/main/000_localmacros
+ cat >>/etc/exim4/update-exim4.conf.conf <<EOF
+dc_eximconfig_configtype='smarthost'
+dc_smarthost='$smarthost'
+# The manpage incorrectly states this will do header rewriting, but
+# that only happens if we have dc_hide_mailname is set.
+dc_readhost='iankelling.org'
+# Only used in case of bounces.
+dc_localdelivery='maildir_home'