Skip Menu |

This queue is for tickets about the Mail-VRFY CPAN distribution.

Report information
The Basics
Id: 35950
Status: resolved
Priority: 0/
Queue: Mail-VRFY

People
Owner: Nobody in particular
Requestors: nine [...] detonation.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.57
Fixed in: (no value)



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;
On Fri May 16 11:53:59 2008, NINE wrote: Show quoted text
> DNS checks run inside an eval block and try to return 3 if they fail.
Show quoted text
> Attached is a patch that fetches the eval block's return value and > returns it from > the sub if no mxhosts were found.
wow, missed that. Thanks!