various fixes
[distro-setup] / mail-setup
index f2623028be96c76a68bb4f869f7c9c7fe63c3353..ee8482d6495f7b53b00ef9a44c6509166d14e292 100755 (executable)
@@ -896,7 +896,8 @@ fi
 
 # * mail monitoring / testing
 if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
-  f=/usr/local/bin/send-test-forward
+  fname=send-test-forward
+  f=/usr/local/bin/$fname
   cat >$f <<'EOFOUTER'
 #!/bin/bash
 /usr/sbin/exim -t <<EOF
@@ -911,10 +912,11 @@ EOFOUTER
 
   cat >/etc/cron.d/mailtest <<EOF
 SHELL=/bin/bash
+PATH=/usr/bin:/bin:/usr/local/bin
 # running as user just because no need to run as root
-*/10 * * * *   $u $f 2>&1 | /usr/local/bin/log-once send-test-forward
-*/10 * * * *   $u /usr/local/bin/mailtest-check 2>&1 | /usr/local/bin/log-once -1 mailtest-check
-*/10 * * * *   root chmod -R g+rw /m/md/bounces 2>&1 | /usr/local/bin/log-once -1 bounces-chmod
+*/10 * * * *   $u $fname |& log-once send-test-forward
+*/10 * * * *   $u mailtest-check |& log-once -1 mailtest-check
+*/10 * * * *   root chmod -R g+rw /m/md/bounces |& log-once -1 bounces-chmod
 EOF
   m cp /a/bin/distro-setup/filesystem/usr/local/bin/mailtest-check /usr/local/bin
 else