-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
-
-
-
-##### 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
-EOF
-# 2017-09, debian closed the bug on this saying upstream had fixed it.
-# remove this when i\'m using the newer package, ie, debian 10, or maybe
-# ubuntu 18.04.
-cat >/etc/systemd/system/spamddnsfix.timer <<'EOF'
-[Unit]
-Description=run spamd bug fix script every 10 minutes
-
-[Timer]
-OnActiveSec=60
-# the script looks back 9 minutes into the journal,
-# it takes a second to run,
-# so lets run every 9 minutes and 10 seconds.
-OnUnitActiveSec=550
-
-[Install]
-WantedBy=timers.target
-EOF
-systemctl daemon-reload
-systemctl restart spamddnsfix.timer
-systemctl enable spamddnsfix.timer
-#
-##### end spamassassin config
-
-
-
-
-
-# https://blog.dhampir.no/content/make-exim4-on-debian-respect-forward-and-etcaliases-when-using-a-smarthost
-# i only need .forwards, so just doing that one.
-cd /etc/exim4/conf.d/router
-b=userforward_higher_priority
-# replace the router name so it is unique
-sed -r s/^\\S+:/$b:/ 600_exim4-config_userforward >175_$b
-
-# begin setup passwd.client
-f=/etc/exim4/passwd.client
-rm -f /etc/exim4/passwd.client
-install -m 640 -g Debian-exim /dev/null $f
-while read -r domain _ pass; do
- # reference: exim4_passwd_client(5)
- printf "%s:%s\n" "$domain" "$pass" >>$f
-done </etc/mailpass
-# end setup passwd.client
-
-# by default, only 10 days of logs are kept. increase that.
-sed -ri 's/^(\s*rotate\s).*/\11000/' /etc/logrotate.d/exim4-base
-
-systemctl restart exim4
-
-
-
-# /etc/alias setup is debian specific, and exim postinst script sets up
-# an /etc/alias from root to the postmaster, based on the question
-# exim4-config exim4/dc_postmaster, as long as there exists an entry for
-# root, or there was no preexisting aliases file. postfix won\'t set up
-# a root to $postmaster alias if it\'s already installed. Easiest to
-# just set it ourselves.
-
-# debconf question for postmaster:
-# Mail for the 'postmaster', 'root', and other system accounts needs to be redirected
-# to the user account of the actual system administrator.
-# If this value is left empty, such mail will be saved in /var/mail/mail, which is not
-# recommended.
-# Note that postmaster\'s mail should be read on the system to which it is directed,
-# rather than being forwarded elsewhere, so (at least one of) the users listed here
-# should not redirect their mail off this machine. A 'real-' prefix can be used to
-# force local delivery.
-# Multiple user names need to be separated by spaces.
-# Root and postmaster mail recipient:
-
-# local mail that bounces goes to /Maildir or /root/Maildir
-dirs=(/m/md/bounces/{cur,tmp,new})
-mkdir -p ${dirs[@]}
-chown -R $u:Debian-exim /m/md/bounces
-chmod 775 ${dirs[@]}
-usermod -a -G Debian-exim $u
-for d in /Maildir /root/Maildir; do
- if [[ ! -L $d ]]; then
- rm -rf $d
- fi
- ln -sf -T /m/md/bounces $d
-done
-
-sudo -u $u ln -sf -T /m/.mu /home/$u/.mu