Connecting Tech Pros Worldwide Forums | Help | Site Map

Net::SMTP Verify problem

Newbie
 
Join Date: Jul 2008
Posts: 1
#1: Jul 7 '08
I'm writing a script that will run a few tests on a given mail server, it's meant to test to see if VRFY and EXPN is enabled or not. However, when I use "verify" to test to see if VRFY is enabled on the given host, if VRFY is disabled on the server the "verify" function will still return true/1.

I used the Debug function to check, and it shows that VRFY is disabled on the mail server.

Is there a reason or a way around this?

snippet of code concerned:

Expand|Select|Wrap|Line Numbers
  1. my $verify = $smtp->verify('root');
  2. if ($verify == 1){
  3.     print "\nVRFY ROOT: YES\n";
  4. } else {
  5.     print "\nVRFY ROOT: NO\n";
  6. }
  7.  
  8. Output:
  9. Net::SMTP=GLOB(0x8327468)>>> VRFY root
  10. Net::SMTP=GLOB(0x8327468)<<< 252 VRFY disabled
  11.  
VRFY ROOT: YES

numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,571
#2: Jul 7 '08

re: Net::SMTP Verify problem


I think that the following line of text from the Net::SMTP web page will help explain this:

Expand|Select|Wrap|Line Numbers
  1. verify ( ADDRESS )
  2.  
  3.     Verify that ADDRESS is a legitimate mailing address.
  4.  
  5.     Most sites usually disable this feature in their SMTP service configuration. Use "Debug => 1" option under new() to see if disabled.
  6.  
Regards,

Jeff
Reply