mail fixes and add je.b8.nz
authorIan Kelling <ian@iankelling.org>
Fri, 30 Oct 2020 05:41:42 +0000 (01:41 -0400)
committerIan Kelling <ian@iankelling.org>
Fri, 30 Oct 2020 05:41:42 +0000 (01:41 -0400)
bk-backup
machine_specific/vps/filesystem/etc/bind/named.conf.local
mail-setup
mailtest-check

index 1c3cc45097ec4ed20852b3eba48c9e91088f4eda..a71e77f0025d242b950e384e37746ca808160c32 100755 (executable)
--- a/bk-backup
+++ b/bk-backup
@@ -21,26 +21,28 @@ esac
 
 if $restore; then
   set -x
-  for ncdir in /var/www/ncexpertpath /var/www/ncninja; do
-    ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running
-    rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir  || ret=$?
-  #   done
+  for ncdir in /var/www/ncexpertpath /var/www/ncninja; do
+    ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running
+    rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir  || ret=$?
+  done
   rsync -ravi /p/bkbackup/rc/ root@$host:/m/rc
   exit 0
 fi
 
+ret=0
 if [[ $HOSTNAME == $MAIL_HOST ]]; then
   mkdir -p /p/bkbackup
   for ncdir in /var/www/ncexpertpath /var/www/ncninja; do
     ncbase=${ncdir##*/}
     mkdir -p /p/bkbackup/$ncbase
     ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on
-    rsync -ra root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
+    rsync -rai --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
     ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --off
-    if (( $ret )) then
-       echo "$0: failed rsync $ncdir"
-       exit $ret
+    if (( $ret )); then
+       echo "$0: error: failed rsync $ncdir"
+       ret=1
     fi
   done
-  rsync -ra root@$host:/m/rc /p/bkbackup
+  rsync -rai --delete root@$host:/m/rc /p/bkbackup
 fi
+exit $ret
index 0655556ff6e8ab5ee1963c27c179f63bf8bc0e38..62f38d27c08c1fa8a1b361fae4a574ba80cf53ef 100644 (file)
@@ -43,3 +43,8 @@ zone "9.c.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa" {
 type master;
 file "/var/lib/bind/db.9.c.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa";
 };
+
+zone "d.9.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa" {
+type master;
+file "/var/lib/bind/db.d.9.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa";
+};
index 33bfa66f455a62ff8713e370b5b573958c375145..046c8d9b6d831cb0dece84d429f4a04b90f0ba8d 100755 (executable)
@@ -9,6 +9,13 @@
 # is being called when it shouldnt when rereunning we are probably
 # updating systemd config file that doesnt need to be or something.
 
+# todo: mailtest-check failure on remote hosts is not going to alert me.
+# sort that out.
+
+# todo: test out icedove
+
+# todo: test out nextcloud mail plugin
+
 # background: I want to run exim in a network namespace so it can send
 # and receive through a vpn. This is needed so it can do ipv6, because
 # outside the namespace if we dont have ipv6, to send ipv6 through the
@@ -1992,7 +1999,7 @@ EOF
     ;;&
   $MAIL_HOST)
     test_from=ian@iankelling.org
-    test_to="testignore@expertpathologyreview.com, testignore@je.bk.nz"
+    test_to="testignore@expertpathologyreview.com, testignore@je.b8.nz"
 
     cat >>/etc/cron.d/mailtest <<EOF
 2   * * * *   $u check-remote-mailqs |& log-once check-remote-mailqs
@@ -2000,7 +2007,7 @@ EOF
     ;;&
   bk)
     test_from=testignore@expertpathologyreview.com
-    test_to="testignore@iankelling.org, testignore@je.bk.nz"
+    test_to="testignore@iankelling.org, testignore@je.b8.nz"
     ;;&
   je)
     test_from=testignore@je.b8.nz
index 606df3fe34ed4de6c378a8816172f7f902aa04b4..2ab174e720cdc68430dc492490c7feb690f01b1b 100755 (executable)
@@ -19,23 +19,29 @@ if [[ ! $1 && $- != *i* ]]; then
 fi
 
 
-folder=/m/md/l/testignore/new
-if [[ $HOSTNAME == bk ]]; then
-  folder=/m/md/expertpathologyreview.com/testignore/cur
-fi
-find $folder -type f -mmin +300 -delete
+folder=/m/md/l/testignore
+case $HOSTNAME in
+  bk)
+    folder=/m/md/expertpathologyreview.com/testignore
+    ;;
+  je)
+    folder=/m/md/je.b8.nz/testignore
+    ;;
+esac
+find $folder/new $folder/cur -type f -mmin +300 -delete
 
 
 cd $folder
 last_sec=0
-for file in *; do
+# webmail sends them to cur it seems
+for file in new/* cur/*; do
   if [[ $file -nt $latest ]]; then
     latest=$file
   fi
 done
 
 if [[ $latest ]]; then
-  last_sec=$(awk '/^Subject: / {print $3}' $latest)
+  last_sec=$(awk '/^Subject: / {print $4}' $latest)
 fi
 
 now=$(date +%s)