+
+# * mail monitoring / testing
+
+case $HOSTNAME in
+ $MAIL_HOST|l2)
+ # note: cronjob "ian" also does some important monitoring
+ cat >/etc/cron.d/mailtest <<EOF
+SHELL=/bin/bash
+PATH=/usr/bin:/bin:/usr/local/bin
+*/5 * * * * $u send-test-forward |& log-once send-test-forward
+*/10 * * * * root chmod -R g+rw /m/md/bounces |& log-once -1 bounces-chmod
+EOF
+ ;;&
+ $MAIL_HOST)
+ test_from=ian@iankelling.org
+ test_to=iank@posteo.de
+
+ cat >>/etc/cron.d/mailtest <<EOF
+*/5 * * * * $u mailtest-check |& log-once -1 mailtest-check
+2 * * * * $u check-remote-mailqs |& log-once check-remote-mailqs
+EOF
+ m sudo rsync -ahhi --chown=root:root --chmod=0755 \
+ /b/ds/mailtest-check /b/ds/check-remote-mailqs /usr/local/bin/
+ ;;&
+ l2)
+ test_from=iank@l2.b8.nz
+ test_to=testignore@iankelling.org
+ ;;&
+ $MAIL_HOST|l2)
+ cat >/usr/local/bin/send-test-forward <<EOFOUTER
+#!/bin/bash
+/usr/sbin/exim -t <<EOF
+From: $test_from
+To: $test_to
+Subject: primary_test \$(date +%s) \$(date +%Y-%m-%dT%H:%M:%S%z)
+
+eom
+EOF
+EOFOUTER
+ m chmod +x /usr/local/bin/send-test-forward
+ ;;
+ *)
+ rm -fv /etc/cron.d/mailtest
+ ;;
+esac
+
+
+
+# * misc
+m sudo -u $u ln -sf -T /m/.mu /home/$u/.mu
+
+
+# /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: