Skip to content

Commit

Permalink
error out if the lookup fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bigio committed May 22, 2024
1 parent 3febfbe commit 4f647f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Mail/SPF/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,10 @@ sub dns_lookup {

$domain =~ s/^(.*?)\.?$/\L$1/; # Normalize domain.

my $packet = $self->dns_resolver->send($domain, $rr_type);
my $packet = eval { $self->dns_resolver->send($domain, $rr_type); };
if($@) {
throw Mail::SPF::ENoAcceptableRecord($@);
}

# Throw DNS exception unless an answer packet with RCODE 0 or 3 (NXDOMAIN)
# was received (thereby treating NXDOMAIN as an acceptable but empty answer packet):
Expand Down

0 comments on commit 4f647f2

Please sign in to comment.