develooper Front page | perl.libnet | Postings from May 2006

Net::POP3 detecting if a server does *not* support SASL authentication

Thread Next
From:
Achim Grolms
Date:
May 28, 2006 07:14
Subject:
Net::POP3 detecting if a server does *not* support SASL authentication
Message ID:
200605281613.09960.achim@grolmsnet.de
Hello,

I am trying to use Net::POP3 to detect if a POP3 Server
does *not* support SASL authentication.

My idea is to use CAPA and check if SASL exists in servers answer:

#------------------------------------------------------------------
#! /usr/bin/perl -w
use strict;
use Net::POP3;

my $targethost = 'pop.web.de';

my $pop = Net::POP3->new( 'pop.web.de' ) || die "can not connect to 
$targethost ";
my $capa = $pop->capa() || die '$pop->capa() failed';

unless ( exists $capa->{'SASL'} ) {
    print "\n I am sure the server does not support SASL\n";
}
#------------------------------------------------------------------

My question is:
Is this code doing what I want, or is it possible the Server
supports a SASL mechanism (like GSSAPI), but does not answer the
CAPA question with 'SASL'?
(Then my code is wrong!)

Thank you,
Achim

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About