[Svn] r4203 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Tue Nov 9 14:49:31 CET 2010


Author: alec
Date: 2010-11-09 07:49:31 -0600 (Tue, 09 Nov 2010)
New Revision: 4203

Modified:
   trunk/roundcubemail/program/include/rcube_imap_generic.php
Log:
- Fix lack of IMAP server response in logged error message when using AUTHENTICATE PLAIN with SASL-IR


Modified: trunk/roundcubemail/program/include/rcube_imap_generic.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap_generic.php	2010-11-09 13:21:02 UTC (rev 4202)
+++ trunk/roundcubemail/program/include/rcube_imap_generic.php	2010-11-09 13:49:31 UTC (rev 4203)
@@ -118,6 +118,7 @@
 
     const COMMAND_NORESPONSE = 1;
     const COMMAND_CAPABILITY = 2;
+    const COMMAND_LASTLINE   = 4;
 
     /**
      * Object constructor
@@ -491,8 +492,8 @@
 
             // 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 @@
 		    $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);
     }
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list