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
1 changed files with 3 additions and 1 deletions

View File

@ -275,7 +275,9 @@ sub get_details {
push @data, "selector: " . $dkim->signature->selector if $dkim->signature;
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;
push @data, "policy: " . $policy->as_string;
push @data, "name: " . $policy->name;