Use eval to get dkim policies (#268)

To prevent a fatal plugin error in case of DNS timeout
This commit is contained in:
Daniel B 2016-06-29 17:35:51 +02:00 committed by Matt Simerson
parent 03c9d045f4
commit e551786a9e

View File

@ -275,7 +275,9 @@ sub get_details {
push @data, "selector: " . $dkim->signature->selector if $dkim->signature; push @data, "selector: " . $dkim->signature->selector if $dkim->signature;
push @data, "result: " . $dkim->result_detail if $dkim->result_detail; push @data, "result: " . $dkim->result_detail if $dkim->result_detail;
foreach my $policy ($dkim->policies) { my @policies = eval { $dkim->policies };
foreach my $policy (@policies) {
next if !$policy; next if !$policy;
push @data, "policy: " . $policy->as_string; push @data, "policy: " . $policy->as_string;
push @data, "name: " . $policy->name; push @data, "name: " . $policy->name;