On Thursday 18 May 2006 21:52, Graham Barr wrote:
> $pop3->auth($sasl); should work. Maybe the docs need updating.
I'm reading the sources of Net::POP3 2.28 (actual CPAN version).
The Code is
#----------------------------------------------------------
sub auth {
my ($self, $username, $password) = @_;
eval {
require MIME::Base64;
require Authen::SASL;
} or $self->set_status(500,["Need MIME::Base64 and Authen::SASL todo
auth"]), return 0;
my $capa = $self->capa;
my $mechanisms = $capa->{SASL} || 'CRAM-MD5';
my $sasl;
if (ref($username) and UNIVERSAL::isa($username,'Authen::SASL')) {
$sasl = $username;
$sasl->mechanism($mechanisms);
}
else {
die "auth(username, password)" if not length $username;
$sasl = Authen::SASL->new(mechanism=> $mechanisms,
callback => { user => $username,
pass => $password,
authname => $username,
});
}
#----------------------------------------------------------
sub auth() does not accept a SASL object as parameter, it creates it's own
SASL object inside.