summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-11-09 13:49:31 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-11-09 13:49:31 +0000
commitfa0e91d0fab4e4de776a975a0c0d6805e5d8d4da (patch)
tree1c189776a0373e727c0ccff09af3f3d864088522 /roundcubemail/program
parent465f8b5097dc16b93015671385354a206f3228e2 (diff)
- Fix lack of IMAP server response in logged error message when using AUTHENTICATE PLAIN with SASL-IR
git-svn-id: https://svn.roundcube.net/trunk@4203 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/rcube_imap_generic.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_imap_generic.php b/roundcubemail/program/include/rcube_imap_generic.php
index 6de27e806..56f30aa81 100644
--- a/roundcubemail/program/include/rcube_imap_generic.php
+++ b/roundcubemail/program/include/rcube_imap_generic.php
@@ -118,6 +118,7 @@ class rcube_imap_generic
const COMMAND_NORESPONSE = 1;
const COMMAND_CAPABILITY = 2;
+ const COMMAND_LASTLINE = 4;
/**
* Object constructor
@@ -491,8 +492,8 @@ class rcube_imap_generic
// RFC 4959 (SASL-IR): save one round trip
if ($this->getCapability('SASL-IR')) {
- $result = $this->execute("AUTHENTICATE PLAIN", array($reply),
- self::COMMAND_NORESPONSE | self::COMMAND_CAPABILITY);
+ list($result, $line) = $this->execute("AUTHENTICATE PLAIN", array($reply),
+ self::COMMAND_LASTLINE | self::COMMAND_CAPABILITY);
}
else {
$this->putLine($this->nextTag() . " AUTHENTICATE PLAIN");
@@ -2888,6 +2889,11 @@ class rcube_imap_generic
$this->parseCapability($matches[1], true);
}
+ // return last line only (without command tag and result)
+ if ($line && ($options & self::COMMAND_LASTLINE)) {
+ $response = preg_replace("/^$tag (OK|NO|BAD|BYE|PREAUTH)?\s*/i", '', trim($line));
+ }
+
return $noresp ? $code : array($code, $response);
}