Index: branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 3749)
+++ branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 3761)
@@ -1724,5 +1724,5 @@
 		if ( $params && $params['noSharedFolders'] )
 			$folders_list = imap_getmailboxes($mbox_stream, $serverString, 'INBOX' ) + $folders_list;
-			
+
 		$folders_list = array_slice($folders_list,0,$this->foldersLimit); 
 
@@ -1732,20 +1732,21 @@
 
 		if (is_array($folders_list)) {
-  			reset($folders_list);
-            		$this->ldap = new ldap_functions();
+			reset($folders_list);
+			$this->ldap = new ldap_functions();
 
 			$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("}", mb_convert_encoding($val->name, "ISO_8859-1", "UTF7-IMAP" ));
-    	        if($tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') {
-        	        //error_log('passou', 3,'/tmp/imap_get_list.log');
-                	//imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas'));
-                	continue;
-                }
-                $result[$i]['folder_unseen'] = $status->unseen;
-	  			$folder_id = $tmp_folder_id[1];
+			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("}", mb_convert_encoding($val->name, "ISO_8859-1", "UTF7-IMAP" ));
+
+				if($tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') {
+					//error_log('passou', 3,'/tmp/imap_get_list.log');
+					//imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas'));
+					continue;
+				}
+				$result[$i]['folder_unseen'] = $status->unseen;
+				$folder_id = $tmp_folder_id[1];
 				$result[$i]['folder_id'] = $folder_id;
 
@@ -1753,4 +1754,5 @@
 				$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();
@@ -1774,12 +1776,12 @@
 					case $spam:
 					case $trash:
-                		   		$resultDefault[]=$result[$i];
-                		   		break;
+						$resultDefault[]=$result[$i];
+						break;
 					default:
-                				$resultMine[]=$result[$i];
+						$resultMine[]=$result[$i];
 				}
 
 				$i++;
-  			}
+			}
 		}
 
Index: branches/2.2/expressoMail1_2/js/TreeS.js
===================================================================
--- branches/2.2/expressoMail1_2/js/TreeS.js	(revision 3361)
+++ branches/2.2/expressoMail1_2/js/TreeS.js	(revision 3761)
@@ -10,5 +10,5 @@
 	}
 
-	treeS.prototype.make_Window = function(){	
+	treeS.prototype.make_Window = function(){
 		_this = this;
 		connector.loadScript("TreeShow");
@@ -20,5 +20,5 @@
 		tree.style.top 		  = "0px";
 		tree.style.width 	  = "0px";
-		tree.style.height 	  = "0px";									
+		tree.style.height 	  = "0px";
 		tree.id				  = "window_tree";
 		document.body.appendChild(tree);
@@ -29,5 +29,5 @@
 		var div_buttons = document.createElement("DIV");
 		div_buttons.id = "div_buttons";
-		div_buttons.style.position = "absolute";		
+		div_buttons.style.position = "absolute";
 		div_buttons.style.left = "440px";
 		div_buttons.style.top = "20px"		
@@ -125,5 +125,5 @@
 	treeS.prototype.make_tree = function (data,destination,name_tree, click_root, opentomb, selected,menu_folder){
 		//Somente para teste
-		//alert("data: " + data.length + "\n" + "destination : " + destination + "\n" + "name_tree : " + name_tree + "\n" + "click_root : " + click_root + "\n" + "opentomb : " + opentomb + "\n" + "selected : " + selected + "\n" + "menu_folder : " + menu_folder);
+ 		// alert("data: " + data.length + "\n" + "destination : " + destination + "\n" + "name_tree : " + name_tree + "\n" + "click_root : " + click_root + "\n" + "opentomb : " + opentomb + "\n" + "selected : " + selected + "\n" + "menu_folder : " + menu_folder); 
 			
 		if(Element('dftree_' + name_tree)){
@@ -136,5 +136,5 @@
 				var n_root = new dNode({id:'root', caption:get_lang("My Folders"), onClick:click_root});
 			}else{
-				var n_root = new dNode({id:'root', caption:get_lang("My Folders")});		
+				var n_root = new dNode({id:'root', caption:get_lang("My Folders")});
 			}
 			folders_tree.add(n_root,'root'); //Places the root; second argument can be anything.
@@ -144,5 +144,5 @@
 				return false;
 			}
-		
+
 			for (var i=0; i<data.length; i++){
 				if(menu_folder){
@@ -163,4 +163,21 @@
 					}
 				}
+				
+				// Foi preciso fazer esse tratamento porque a api (imap_getmailboxes) do PHP retorna uma informação incorreta em algumas ocasiões
+				// a função imap_getmailboxes não retorna o atributo 32 (has_children) quando tem pastas seguindo o seguinte padrão:
+				// prefixo
+				//    subPasta1
+				//    subPasta2
+				// prefixo-pasta2  (tudo devido a este underscore aqui)
+				// Caso seja criada pastas dessa forma, a pasta "prefixo", fica com a flag folder_hasChildren como false
+				// sendo assim não aparece o sinal de "mais" na árvore de pastas para poder expandir
+				// Olhar a chamada para a função imap_getmailboxes() dentro do método expressoMail1_2.imap_functions.get_folders_list()
+				// Ticket #1548
+				if(data[i].folder_parent != 'root') {
+					var node_parent = folders_tree.getNodeById(data[i].folder_parent);
+					node_parent.plusSign = true;
+					folders_tree.alter(node_parent);
+				}
+				
 				folders_tree.add(nn,data[i].folder_parent);
 			}
