Index: branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5621)
+++ branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5873)
@@ -1855,63 +1855,48 @@
 			$i = 0;
 			while (list($key, $val) = each($folders_list)) {
-				$status = imap_status($mbox_stream, $val->name, SA_UNSEEN);
-
-				//$tmp_folder_id = explode("}", imap_utf7_decode($val->name));
-				$tmp_folder_id = explode("}", $val->name );
-
-				$folderUser = trim( strpos( $tmp_folder_id[1], $this->imap_delimiter , 5 ) );
-
-                            $folderUser = trim( substr( $tmp_folder_id[1], 0, $folderUser ) );
-
-                            $Permission = true;
-
-                            if( $folderUser != "INBOX" && $folderUser != "" )
+                            $status = imap_status($mbox_stream, $val->name, SA_UNSEEN);
+
+                            //$tmp_folder_id = explode("}", imap_utf7_decode($val->name));
+                            $tmp_folder_id = explode("}", $val->name );
+
+                            $tmp_folder_id[1] = mb_convert_encoding( $tmp_folder_id[1], "ISO-8859-1", "UTF7-IMAP" );
+
+                            if( $tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas')
                             {
-                               $Permission = imap_getacl( $mbox_stream, $folderUser );
+                                    continue;
                             }
-
-                            if( $Permission )
-                            {
-                                $tmp_folder_id[1] = mb_convert_encoding( $tmp_folder_id[1], "ISO-8859-1", "UTF7-IMAP" );
-
-                                if( $tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas')
-                                {
-					continue;
-				}
-				$result[$i]['folder_unseen'] = $status->unseen;
-				$folder_id = $tmp_folder_id[1];
-				$result[$i]['folder_id'] = $folder_id;
-
-				$tmp_folder_parent = explode($this->imap_delimiter, $folder_id);
-				$result[$i]['folder_name'] = array_pop($tmp_folder_parent);
-				$result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name'];
-			
-				if ($uid2cn && substr($folder_id,0,4) == 'user') {
-					//$this->ldap = new ldap_functions();
-					if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])) {
-						$result[$i]['folder_name'] = $cn;
-					}
-				}
-
-				$tmp_folder_parent = implode($this->imap_delimiter, $tmp_folder_parent);
-				$result[$i]['folder_parent'] = $tmp_folder_parent == 'INBOX' ? '' : $tmp_folder_parent;
-
-				if (($val->attributes == 32) && ($result[$i]['folder_name'] != 'Inbox'))
-					$result[$i]['folder_hasChildren'] = 1;
-				else
-					$result[$i]['folder_hasChildren'] = 0;
-
-				switch ($tmp_folder_id[1]) {
-					case $inbox:
-					case $sent:
-					case $drafts:
-					case $spam:
-					case $trash:
-						$resultDefault[]=$result[$i];
-						break;
-					default:
-						$resultMine[]=$result[$i];
-				}
-
+                            $result[$i]['folder_unseen'] = $status->unseen;
+                            $folder_id = $tmp_folder_id[1];
+                            $result[$i]['folder_id'] = $folder_id;
+
+                            $tmp_folder_parent = explode($this->imap_delimiter, $folder_id);
+                            $result[$i]['folder_name'] = array_pop($tmp_folder_parent);
+                            $result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name'];
+
+                            if ($uid2cn && substr($folder_id,0,4) == 'user') {
+                                    //$this->ldap = new ldap_functions();
+                                    if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])) {
+                                            $result[$i]['folder_name'] = $cn;
+                                    }
+                            }
+
+                            $tmp_folder_parent = implode($this->imap_delimiter, $tmp_folder_parent);
+                            $result[$i]['folder_parent'] = $tmp_folder_parent == 'INBOX' ? '' : $tmp_folder_parent;
+
+                            if (($val->attributes == 32) && ($result[$i]['folder_name'] != 'Inbox'))
+                                    $result[$i]['folder_hasChildren'] = 1;
+                            else
+                                    $result[$i]['folder_hasChildren'] = 0;
+
+                            switch ($tmp_folder_id[1]) {
+                                    case $inbox:
+                                    case $sent:
+                                    case $drafts:
+                                    case $spam:
+                                    case $trash:
+                                            $resultDefault[]=$result[$i];
+                                            break;
+                                    default:
+                                            $resultMine[]=$result[$i];
                             }
                             $i++;
