fixup gitignore
[distro-setup] / mail-setup
index 6a291c444748eacd3dbafd6d1e4dcf202aa37cf3..98723469b8d144e84855f68875e2545b6e4d1929 100755 (executable)
@@ -14,6 +14,9 @@
 # todo: handle errors like this:
 # Mar 02 12:44:26 kw systemd[1]: exim4.service: Found left-over process 68210 (exim4) in control group while starting unit. Ignoring.
 # Mar 02 12:44:26 kw systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
+#eg: on eggs, on may 1st, ps grep for exim, 2 daemons running. 1 leftover from a month ago
+#Debian-+  1954     1  0 36231 11560   4 Apr02 ?        00:40:25 /usr/sbin/exim4 -bd -q30m
+#Debian-+ 23058  1954  0 36821 10564   0 20:38 ?        00:00:00 /usr/sbin/exim4 -bd -q30m
 
 #  todo: harden dovecot. need to do some research. one way is for it to only listen on a wireguard vpn interface, so only clients that are on the vpn can access it.
 #  todo: consider hardening cups listening on 0.0.0.0
@@ -287,7 +290,8 @@ i() { # install file
   local base="${dest##*/}"
   local dir="${dest%/*}"
   if [[ $dir != "$base" ]]; then
-    mkdir -p ${dest%/*}
+    # dest has a directory component
+    mkdir -p "$dir"
   fi
   ir=false # i result
   tmpdir=$(mktemp -d)
@@ -1225,8 +1229,7 @@ warn
 
 warn
   !hosts = +iank_trusted
-  # They dont send spam, but needed this because
-  # smarthosts connect with residential ips and thus get flagged as spam.
+  # Smarthosts connect with residential ips and thus get flagged as spam if we do a spam check.
   !authenticated = plain_server:login_server
   condition = ${if < {$message_size}{5000K}}
   spam = Debian-exim:true
@@ -1237,6 +1240,7 @@ warn
   add_header = X-Spam_action: $spam_action
 
 warn
+  !hosts = +iank_trusted
   !authenticated = plain_server:login_server
   condition = ${if def:malware_name}
   remove_header = Subject:
@@ -3300,7 +3304,9 @@ EOFOUTER
     ;;
   *)
     soff mailtest-check.service
-    rm -fv /etc/cron.d/mailtest /var/lib/prometheus/node-exporter/mailtest-check.prom*
+    rm -fv /etc/cron.d/mailtest \
+       /var/lib/prometheus/node-exporter/mailtest-check.prom* \
+       /var/local/cron-errors/check-remote-mailqs*
     ;;
 esac