Subject: | CheckAddress always gives 4 on DNS check failures |
DNS checks run inside an eval block and try to return 3 if they fail. But the
return does only exit from the eval block and not from the sub so this exit code
will never get checked.
print Mail::VRFY::CheckAddress(q(olegtro@geophys.spb.su));
gives 4 instead of the expected 3 (geophys.spb.su does not have any MX or A
records)
Attached is a patch that fetches the eval block's return value and returns it from
the sub if no mxhosts were found.
Subject: | Mail-VRFY-DNS-check.diff |
diff -ur Mail-VRFY-0.57.orig/VRFY.pm Mail-VRFY-0.57/VRFY.pm
--- Mail-VRFY-0.57.orig/VRFY.pm 2007-05-04 19:18:10.000000000 +0200
+++ Mail-VRFY-0.57/VRFY.pm 2008-05-16 17:43:11.000000000 +0200
@@ -179,7 +179,7 @@
}
return 0 if($arg{method} eq 'syntax');
- eval {
+ my $dnscheck = eval {
local $SIG{ALRM} = sub { die "Timeout.\n"; };
alarm($arg{timeout});
my @mxrr = Net::DNS::mx( $domain );
@@ -210,6 +210,8 @@
return 3;
}
+ return $dnscheck unless @mxhosts;
+
my $misbehave=0;
my $tmpfail=0;
my $livesmtp=0;