+ rm -f $resultfile
+ for r in ${results[@]}; do
+ case $r in
+ # iank: for when we want to handle dns errors differently.
+ # also uncomment declaration of dnsfail above.
+ # DKIM_INVALID|T_SPF_TEMPERROR|T_SPF_HELO_TEMPERROR)
+ # dnsfail+=1
+ # ;;
+ *)
+ unexpected=$(( unexpected + 1 ))
+ ;;
+ esac
+ done
+ for miss in ${missing[@]}; do
+ # At some point we had annoying dns failures that we couldn't solve so we
+ # we counted dns fail related results separately and alert differently.
+ # DKIM_VALID|DKIM_VALID_AU|DKIM_VALID_EF|SPF_HELO_PASS|SPF_PASS|
+ case $miss in
+ *)
+ unexpected+=1
+ ;;
+ esac
+ done
+ mapfile -O ${#p_missing_dnswl[@]} -t p_missing_dnswl <<EOF
+mailtest_check_missing_dnswl{folder="$folder",from="$from"} $missing_dnswl
+EOF
+ mapfile -O ${#p_unexpected_spamd_results[@]} -t p_unexpected_spamd_results <<EOF
+mailtest_check_unexpected_spamd_results{folder="$folder",from="$from"} $unexpected
+EOF