From e7d997915dac4e4a08995e6ba40dd50c92cafc4a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 23 Jul 2012 08:52:23 +0200 Subject: Update Net_SMTP/Auth_SASL packages to fix Digest-MD5/Cram-MD5 authentication (#1488571) --- program/lib/Net/SMTP.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'program/lib/Net/SMTP.php') diff --git a/program/lib/Net/SMTP.php b/program/lib/Net/SMTP.php index 4e04f9191..2c1ef5c55 100644 --- a/program/lib/Net/SMTP.php +++ b/program/lib/Net/SMTP.php @@ -17,8 +17,6 @@ // | Jon Parise | // | Damian Alejandro Fernandez Sosa | // +----------------------------------------------------------------------+ -// -// $Id$ require_once 'PEAR.php'; require_once 'Net/Socket.php'; @@ -189,7 +187,7 @@ class Net_SMTP /* Include the Auth_SASL package. If the package is available, we * enable the authentication methods that depend upon it. */ - if ((@include_once 'Auth/SASL.php') === true) { + if (@include_once 'Auth/SASL.php') { $this->setAuthMethod('CRAM-MD5', array($this, '_authCram_MD5')); $this->setAuthMethod('DIGEST-MD5', array($this, '_authDigest_MD5')); } @@ -727,7 +725,7 @@ class Net_SMTP } $challenge = base64_decode($this->_arguments[0]); - $digest = &Auth_SASL::factory('digestmd5'); + $digest = &Auth_SASL::factory('digest-md5'); $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge, $this->host, "smtp", $authz)); @@ -779,7 +777,7 @@ class Net_SMTP } $challenge = base64_decode($this->_arguments[0]); - $cram = &Auth_SASL::factory('crammd5'); + $cram = &Auth_SASL::factory('cram-md5'); $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge)); if (PEAR::isError($error = $this->_put($auth_str))) { @@ -1004,14 +1002,12 @@ class Net_SMTP */ function quotedata(&$data) { - /* Change Unix (\n) and Mac (\r) linefeeds into - * Internet-standard CRLF (\r\n) linefeeds. */ - $data = preg_replace(array('/(?