If the request was sucessful each line should be prepended by a 2xx status code and SMTP in the line.
$line =~ /^2\d\d .*SMTP/ should work as a rudimentary test for the first line back.
Update:
use strict; use warnings; use Net::Telnet; my $tel = Net::Telnet->new(-host => 'localhost', -port => 25, -errmode + => 'return') or die "Port not available\n"; my $rtn = $tel->getline() or die "No Reponse\n"; print $rtn =~ /^2\d\d .*SMTP/ ? 'OK' : 'Fail';
In reply to Re: Checking SMTP ports.
by grep
in thread Checking SMTP ports.
by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |