On Monday 22 May 2006 19:50, Dennis Putnam wrote:
> Doesn't work. Nothing is in '$!' but the POP log says "badlogin".

Try if this works:

#------usage example--------------
use strict;

use Authen::SASL 2.10 qw(Perl);
use Net::POP3;

my $pop3host = 'pop3host';

my $sasl = Authen::SASL->new( mechanism => 'GSSAPI' );
my $pop = Net::POP3->new( $pop3host ) || die "can not connect to $pop3host ";
if ( $pop->auth($sasl) ) {
    my $msgnums = $pop->list; # hashref of msgnum => size
    foreach my $msgnum (keys %$msgnums) {
        my $msg = $pop->get($msgnum);
        print @$msg;
    }
}
else {
   die "\n Authentication error from SASL: \n",
       $sasl->error;
}
$pop->quit;
#------end of usage example--------------

Reply via email to