+ rm -f $resultfile
+ for r in ${results[@]}; do
+ case $r in
+ # iank: for when we want to handle dns errors differently
+ # DKIM_INVALID|T_SPF_TEMPERROR|T_SPF_HELO_TEMPERROR)
+ # dnsfail+=1
+ # ;;
+ *)
+ unexpected=$(( unexpected + 1 ))
+ ;;
+ esac
+ done
+ for miss in ${missing[@]}; do
+ # We expect dns failures from time to time, so
+ # we count them separately and alert differently.
+ case $miss in
+ # 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
+ ;;
+ *)
+ unexpected+=1
+ ;;
+ esac
+ done
+ mapfile -O ${#missing_dnswl[@]} -t missing_dnswl <<EOF
+mailtest_check_missing_dnswl{folder="$folder",from="$from"} $missing_dnswl
+EOF
+ mapfile -O ${#unexpected_spamd_results[@]} -t unexpected_spamd_results <<EOF
+mailtest_check_unexpected_spamd_results{folder="$folder",from="$from"} $unexpected
+EOF