From fc66074daf7f22b9f0bfc1129a90551adfe918c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Karall-Ahlborn Date: Thu, 18 Mar 2021 20:53:28 +0100 Subject: Force disposition to be 'unknown' too if it doesn't match the enum values. Rather there's 'unknown' in the DB column than empty strings. --- dmarcts-report-parser.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dmarcts-report-parser.pl b/dmarcts-report-parser.pl index e140ce4..6b473fc 100755 --- a/dmarcts-report-parser.pl +++ b/dmarcts-report-parser.pl @@ -867,6 +867,9 @@ sub storeXMLInDatabase { #print "ip $ip\n"; my $count = $r{'row'}->{'count'}; my $disp = $r{'row'}->{'policy_evaluated'}->{'disposition'}; + if ( ! grep { $_ eq $disp } ALLOWED_DISPOSITION ) { + $disp = 'unknown'; + }; # some reports don't have dkim/spf, "unknown" is default for these my $dkim_align = $r{'row'}->{'policy_evaluated'}->{'dkim'}; if ( ! grep { $_ eq $dkim_align } ALLOWED_DKIM_ALIGN ) { -- cgit v1.2.3