diff options
author | Wolfgang Karall-Ahlborn <github@karall-edv.at> | 2021-03-07 19:58:54 +0300 |
---|---|---|
committer | Wolfgang Karall-Ahlborn <github@karall-edv.at> | 2021-03-07 19:58:54 +0300 |
commit | f44c78e413732416ff953f6c332a3770821cc7a6 (patch) | |
tree | 7c936971d2b8a5ae1062959d7f65981c05c23a5b /dmarcts-report-parser.pl | |
parent | 1b80ad21e743813256d7e20854b109bde652d799 (diff) |
Avoid fatal error when there's no 'auth_results' in the XML
Reports seen in the wild sometime lack actual 'auth_results' in the XML
which leads to
Can't use string ("") as a HASH ref while "strict refs" in use
Diffstat (limited to 'dmarcts-report-parser.pl')
-rwxr-xr-x | dmarcts-report-parser.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dmarcts-report-parser.pl b/dmarcts-report-parser.pl index 2de3b04..5c3c9eb 100755 --- a/dmarcts-report-parser.pl +++ b/dmarcts-report-parser.pl @@ -813,6 +813,10 @@ sub storeXMLInDatabase { my $identifier_hfrom = $r{'identifiers'}->{'header_from'}; my ($dkim, $dkimresult, $spf, $spfresult, $reason); + if(ref $r{'auth_results'} ne "HASH"){ + print "Report has no auth_results data. Skipped.\n"; + return 0; + } my $rp = $r{'auth_results'}->{'dkim'}; if(ref $rp eq "HASH") { $dkim = $rp->{'domain'}; |