X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mailtest-check;h=036aeff1a2faf981367d7ff69f9ebb98cff26a58;hb=090c49e2a17530c560488270e681d3e23046afc5;hp=c7d40c17502e967b808e2e251a6b50b63cb1464c;hpb=774fe9ab8c8d5c71614feda5a283b4a91fb3f145;p=distro-setup diff --git a/mailtest-check b/mailtest-check index c7d40c1..036aeff 100755 --- a/mailtest-check +++ b/mailtest-check @@ -57,10 +57,11 @@ if [[ $1 == nonint ]]; then fi #### end arg processing #### - -if ! $int; then - sleep 60 -fi +# we put this in to avoid dns errors that happen on reboot, +# but I want to debug them. +# if ! $int; then +# sleep 60 +# fi # TODO, get je to deliver the local mailbox: /m/md/INBOX @@ -103,6 +104,7 @@ main() { try_left=$(( try_limit - ( EPOCHSECONDS - try_start_time) )) timeout=120 # somewhat arbitrary value if (( try_left < 0 )); then + echo "mailtest-check: failed to rsync fencepost > $try_limit seconds" break fi if (( try_left < timeout )); then @@ -144,9 +146,11 @@ EOF fi tmpfile=$(mktemp) declare -i unexpected=0 - declare -i missing_dnswl=0 for folder in ${folders[@]}; do for from in ${froms[@]}; do + declare -i missing_dnswl=0 + declare -i dnsfail=0 + declare -i unexpected=0 latest= last_sec=0 @@ -215,8 +219,8 @@ EOF # eggs has RCVD_IN_DNSWL_MED keys+=(RCVD_IN_DNSWL_MED) elif [[ $from == *@gnu.org ]]; then - # eggs has these - keys+=(RCVD_IN_DNSWL_MED DKIMWL_WL_HIGH) + # eggs has this. it used to have DKIMWL_WL_HIGH sometime in 2022 + keys+=(RCVD_IN_DNSWL_MED) fi for t in ${keys[@]}; do @@ -264,9 +268,10 @@ EOF rm -f $resultfile for r in ${results[@]}; do case $r in - DKIM_INVALID|T_SPF_TEMPERROR|T_SPF_HELO_TEMPERROR) - missing_dnswl+=1 - ;; + # iank: for when we want to handle dns errors differently + # DKIM_INVALID|T_SPF_TEMPERROR|T_SPF_HELO_TEMPERROR) + # dnsfail+=1 + # ;; *) unexpected=$(( unexpected + 1 )) ;; @@ -276,7 +281,9 @@ EOF # We expect dns failures from time to time, so # we count them separately and alert differently. case $miss in - DKIM_VALID|DKIM_VALID_AU|DKIM_VALID_EF|SPF_HELO_PASS|SPF_PASS|RCVD_IN_DNSWL_MED|DKIMWL_WL_HIGH) + # iank: dns fail + # DKIM_VALID|DKIM_VALID_AU|DKIM_VALID_EF|SPF_HELO_PASS|SPF_PASS| + RCVD_IN_DNSWL_MED|DKIMWL_WL_HIGH) missing_dnswl+=1 ;; *) @@ -284,6 +291,10 @@ EOF ;; esac done + pr <