PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_POP3 » Bug #2646

APOP attempted when not supported

Details

Submitted2004-10-29 17:14 UTC
Fromosdave at nospam_davepar dot com
Assigneddamian
StatusClosed
PackageNet_POP3
PHP Version4.3.5
OSlinux
Roadmaps(Not assigned)

Comments

[2004-10-29 17:14 UTC] osdave at nospam_davepar dot com

Description:
------------
My server doesn't report any auth methods in the capabilities, so the POP package attempts to use APOP, which it also doesn't support.

S:+OK Hello there.
C: CAPA
S:+OK Here's what I can do:
S:TOP
S:USER
S:LOGIN-DELAY 10
S:PIPELINING
S:UIDL
S:IMPLEMENTATION Courier Mail Server

S:.

POP package tries to use APOP at this point, but the timestamp isn't set. It then returns "Not In NET_POP3_STATE_AUTHORISATION State1"

I made a fix for _getBestAuthMethod:

if( isset($this->_capability['sasl']) ){
$serverMethods=$this->_capability['sasl'];
}else{
$serverMethods=array('USER');
// Check for timestamp before attempting APOP
if ($this->_timestamp != null)
{
$serverMethods[] = 'APOP';
}
}

[2004-10-29 17:28 UTC] osdave at nospam_davepar dot com

I found another related problem. The logic in _cmdAuthenticate is not falling back to USER correctly when APOP fails. It's checking for a false return code from _cmdApop, but that function now returns a PEAR error when it fails.