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

trac at roundcube.net trac at roundcube.net
Mon Jun 27 18:27:11 CEST 2011


Author: alec
Date: 2011-06-27 11:27:11 -0500 (Mon, 27 Jun 2011)
New Revision: 4885

Modified:
   trunk/roundcubemail/program/include/rcube_imap_generic.php
Log:
- Fix handling of untagged responses in LIST/LSUB response parser


Modified: trunk/roundcubemail/program/include/rcube_imap_generic.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap_generic.php	2011-06-27 15:53:40 UTC (rev 4884)
+++ trunk/roundcubemail/program/include/rcube_imap_generic.php	2011-06-27 16:27:11 UTC (rev 4885)
@@ -2180,7 +2180,7 @@
             while ($this->tokenizeResponse($response, 1) == '*') {
                 $cmd = strtoupper($this->tokenizeResponse($response, 1));
                 // * LIST (<options>) <delimiter> <mailbox>
-                if (!$lstatus || $cmd == 'LIST' || $cmd == 'LSUB') {
+                if ($cmd == 'LIST' || $cmd == 'LSUB') {
                     list($opts, $delim, $mailbox) = $this->tokenizeResponse($response, 3);
 
                     // Add to result array
@@ -2209,6 +2209,14 @@
                         $folders[$mailbox][$name] = $value;
                     }
                 }
+                // other untagged response line, skip it
+                else {
+                    $response = ltrim($response);
+                    if (($position = strpos($response, "\n")) !== false)
+                        $response = substr($response, $position+1);
+                    else
+                        $response = '';
+                }
             }
 
             return $folders;

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



More information about the Svn mailing list