diff options
author | Wolfgang Karall-Ahlborn <wolfgangkarall@users.noreply.github.com> | 2021-03-18 22:53:28 +0300 |
---|---|---|
committer | Wolfgang Karall-Ahlborn <wolfgangkarall@users.noreply.github.com> | 2021-03-18 22:53:28 +0300 |
commit | fc66074daf7f22b9f0bfc1129a90551adfe918c7 (patch) | |
tree | 7b5d37fd28bc888a6c989577200c253ef14aa4ad | |
parent | a2945aadc612383554f374721bef508965de0efb (diff) |
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.
-rwxr-xr-x | dmarcts-report-parser.pl | 3 |
1 files changed, 3 insertions, 0 deletions
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 ) { |