summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-12-18 10:15:39 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-12-18 10:15:39 +0000
commitb4ca221b5ab95289ef6ea3d87498b620991062b4 (patch)
tree7a71fb8b511122402e0d9ae9b232369f5c30f9db
parentd12fbc5dd66a6fb7c6e1f7345edaab3018693ba7 (diff)
- Fix STARTTLS before AUTH in SMTP connection (#1484883)
git-svn-id: https://svn.roundcube.net/trunk@2170 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/CHANGELOG4
-rw-r--r--roundcubemail/program/lib/Net/SMTP.php19
2 files changed, 11 insertions, 12 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG
index 7228b440d..8e550514a 100644
--- a/roundcubemail/CHANGELOG
+++ b/roundcubemail/CHANGELOG
@@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
+2008/12/18 (alec)
+----------
+- Fix STARTTLS before AUTH in SMTP connection (#1484883)
+
2008/12/16 (thomasb)
----------
- Only abbreviate file name for IE browsers (#1485063)
diff --git a/roundcubemail/program/lib/Net/SMTP.php b/roundcubemail/program/lib/Net/SMTP.php
index 005691d56..b9ad4b2e8 100644
--- a/roundcubemail/program/lib/Net/SMTP.php
+++ b/roundcubemail/program/lib/Net/SMTP.php
@@ -375,7 +375,7 @@ class Net_SMTP
return true;
}
-
+console($this->_arguments);
foreach ($this->_arguments as $argument) {
$verb = strtok($argument, ' ');
$arguments = substr($argument, strlen($verb) + 1,
@@ -424,11 +424,8 @@ class Net_SMTP
*/
function auth($uid, $pwd , $method = '')
{
- if (empty($this->_esmtp['AUTH'])) {
- if (version_compare(PHP_VERSION, '5.1.0', '>=')) {
- if (!isset($this->_esmtp['STARTTLS'])) {
- return PEAR::raiseError('SMTP server does not support authentication');
- }
+ if (version_compare(PHP_VERSION, '5.1.0', '>=') && isset($this->_esmtp['STARTTLS'])) {
+
if (PEAR::isError($result = $this->_put('STARTTLS'))) {
return $result;
}
@@ -444,12 +441,10 @@ class Net_SMTP
/* Send EHLO again to recieve the AUTH string from the
* SMTP server. */
$this->_negotiate();
- if (empty($this->_esmtp['AUTH'])) {
- return PEAR::raiseError('SMTP server does not support authentication');
- }
- } else {
- return PEAR::raiseError('SMTP server does not support authentication');
- }
+ }
+
+ if (empty($this->_esmtp['AUTH'])) {
+ return PEAR::raiseError('SMTP server does not support authentication');
}
/* If no method has been specified, get the name of the best