- newaliases
- fi
-
- # put spool dir in directory that spans multiple distros.
- # based on http://www.postfix.org/qmgr.8.html and my notes in gnus
- #
- # todo: I\'m suspicious of uids for Debian-exim being the same across
- # distros. It would be good to test this.
- dir=/nocow/$type
- sdir=/var/spool/$type
- # we only do this if our system has $dir
- if [[ -e /nocow && $(readlink -f $sdir) != $dir ]]; then
- systemctl stop $type
- if [[ ! -e $dir && -d $sdir ]]; then
- mv $sdir $dir
- fi
- /a/exe/lnf -T $dir $sdir
- fi
-
- systemctl restart $type
- systemctl enable $type
-
- # MAIL_HOST also does radicale, and easier to start and stop it here
- # for when MAIL_HOST changes, so radicale gets the synced files and
- # does not stop us from remounting /o.
- if dpkg -s radicale &>/dev/null; then
- if [[ $HOSTNAME == $MAIL_HOST ]]; then
- systemctl restart radicale
- systemctl enable radicale
- if [[ -e /etc/logrotate.d/radicale.disabled ]]; then
- mv /etc/logrotate.d/radicale{.disabled,}
- fi
- else
- systemctl stop radicale
- systemctl disable radicale
- # weekly logrotate tries to restart radicale even if it's a disabled service in flidas.
- if [[ -e /etc/logrotate.d/radicale ]]; then
- mv /etc/logrotate.d/radicale{,.disabled}
- fi
- fi
- fi
- exit 0
-
- # if I wanted the from address to be renamed and sent to a different address,
- # echo "sdx@localhost development@localhost" | sudo dd of=/etc/postfix/recipient_canonical
- # sudo postmap hash:/etc/postfix/recipient_canonical
- # sudo service postfix reload
+ newaliases
+fi
+
+# put spool dir in directory that spans multiple distros.
+# based on http://www.postfix.org/qmgr.8.html and my notes in gnus
+#
+# todo: I\'m suspicious of uids for Debian-exim being the same across
+# distros. It would be good to test this.
+dir=/nocow/exim4
+sdir=/var/spool/exim4
+# we only do this if our system has $dir
+
+# this used to do a symlink, but, in the boot logs, /nocow would get mounted succesfully,
+# about 2 seconds later, exim starts, and immediately puts into paniclog:
+# honVi-0000u3-82 Failed to create directory "/var/spool/exim4/input": No such file or directory
+# so, im trying a bind mount to get rid of that.
+if [[ -e /nocow ]]; then
+ if ! grep -Fx "/nocow/exim4 /var/spool/exim4 none bind 0 0" /etc/fstab; then
+ echo "/nocow/exim4 /var/spool/exim4 none bind 0 0" >> /etc/fstab
+ fi
+ if ! mountpoint -q $sdir; then
+ systemctl stop exim4
+ if [[ -L $sdir ]]; then
+ rm $sdir
+ fi
+ if [[ ! -e $dir && -d $sdir ]]; then
+ mv $sdir $dir
+ fi
+ if [[ ! -d $sdir ]]; then
+ mkdir $sdir
+ chmod 000 $sdir # only want it to be used when its mounted
+ fi
+ mount $sdir
+ fi
+fi
+
+systemctl restart exim4
+systemctl enable exim4
+
+
+if [[ $HOSTNAME == $MAIL_HOST ]]; then
+ cat >/etc/cron.d/mailtest <<'EOF'
+*/10 * * * * iank echo body_test | mail -s "primary_test $(date +%s) $(date +%Y-%m-%dT%H:%M:%S%z)" iank@posteo.de
+2/10 * * * * root /usr/local/bin/mailtest-check
+EOF
+ cp /a/bin/distro-setup/filesystem/usr/local/bin/mailtest-check /usr/local/bin
+else
+ rm -f /etc/cron.d/mailtest
+fi
+
+# MAIL_HOST also does radicale, and easier to start and stop it here
+# for when MAIL_HOST changes, so radicale gets the synced files and
+# does not stop us from remounting /o.
+if dpkg -s radicale &>/dev/null; then
+ if [[ $HOSTNAME == $MAIL_HOST ]]; then
+ systemctl restart radicale
+ systemctl enable radicale
+ if [[ -e /etc/logrotate.d/radicale.disabled ]]; then
+ mv /etc/logrotate.d/radicale{.disabled,}
+ fi
+ else
+ systemctl stop radicale
+ systemctl disable radicale
+ # weekly logrotate tries to restart radicale even if it's a disabled service in flidas.
+ if [[ -e /etc/logrotate.d/radicale ]]; then
+ mv /etc/logrotate.d/radicale{,.disabled}
+ fi
+ fi
+fi
+exit 0
+: