mostly fixes
[distro-setup] / mail-setup
index e12149f114bc06b0b79bc980359cb6dd743f8b8d..041ab1d58db145e8ea8a2d8af07a1d60eb4db073 100755 (executable)
 # todo: run mailping test after running, or otherwise
 # clear out terminal alert
 
-# todo: on bk, dont send email if mailvpn is not up
-
-# todo: mailtest-check should check on bk too
-
 # todo: disable postgrey
 
 # todo: in testforward-check, we should also look
@@ -1212,6 +1208,7 @@ accept
 EOF
 
 rm -fv /etc/exim4/data_local_acl # old path
+
 i /etc/exim4/conf.d/data_local_acl <<'EOF'
 # Except for the "condition =", this was
 # a comment in the check_data acl. The comment about this not
@@ -1230,6 +1227,9 @@ warn
 
 warn
   !hosts = +iank_trusted
+  # They dont send spam, but needed this because
+  # smarthosts connect with residential ips and thus get flagged as spam.
+  !authenticated = plain_server:login_server
   condition = ${if < {$message_size}{5000K}}
   spam = Debian-exim:true
   add_header = X-Spam_score_int: $spam_score_int
@@ -1239,6 +1239,7 @@ warn
   add_header = X-Spam_action: $spam_action
 
 warn
+  !authenticated = plain_server:login_server
   condition = ${if def:malware_name}
   remove_header = Subject:
   add_header = Subject: [Clamav warning: $malware_name] $h_subject
@@ -3200,14 +3201,12 @@ case $HOSTNAME in
     # note: cronjob "ian" also does some important monitoring
     # todo: this will sometimes cause an alert because mailtest-check will run
     # before we have setup network namespace and spamassassin
-    cat >/etc/cron.d/mailtest <<EOF
+    /etc/cron.d/mailtest <<EOF
 SHELL=/bin/bash
 PATH=/usr/bin:/bin:/usr/local/bin
 MAILTO=daylert@iankelling.org
 */5  * * * *   $u send-test-forward |& log-once send-test-forward
 */10 * * * *   root chmod -R g+rw /m/md/bounces |& log-once -1 bounces-chmod
-# todo: delete, this is old
-#*/5  * * * *   root timeout 290 mailtest-check slow |& log-once -1 mailtest-check
 # if a bounce happened yesterday, dont let it slip through the cracks
 8   1 * * *   root export MAILTO=alerts@iankelling.org; [[ -s /var/log/exim4/mainlog.1 ]] && awk '\$5 == "**"' /var/log/exim4/mainlog.1
 EOF
@@ -3215,7 +3214,7 @@ EOF
 
     m sudo rsync -ahhi --chown=root:root --chmod=0755 \
       /b/ds/mailtest-check /b/ds/check-remote-mailqs /usr/local/bin/
-    cat >/etc/systemd/system/mailtest-check.service <<'EOF'
+    /etc/systemd/system/mailtest-check.service <<'EOF'
 [Unit]
 Description=mailtest-check
 After=local-fs.target