Index: sandbox/newExpressoMail/prototype/Sync.php
===================================================================
--- sandbox/newExpressoMail/prototype/Sync.php	(revision 6328)
+++ sandbox/newExpressoMail/prototype/Sync.php	(revision 7266)
@@ -4,6 +4,49 @@
 $accept = $_SERVER["HTTP_ACCEPT"];
 
+if(!function_exists('getRealREQUEST'))
+{
+    function getRealREQUEST() {
+        $vars = array();
+
+        if(isset($_SERVER['REDIRECT_QUERY_STRING']))
+            $input    = $_SERVER['REDIRECT_QUERY_STRING'];
+
+        if(!empty($input)){
+            $pairs    = explode("&", $input);
+            foreach ($pairs     as $pair) {
+                $nv                = explode("=", $pair);
+
+                $name            = urldecode($nv[0]);
+                $nameSanitize    = preg_replace('/([^\[]*)\[.*$/','$1',$name);
+
+                $nameMatched    = str_replace('.','_',$nameSanitize);
+                $nameMatched    = str_replace(' ','_',$nameMatched);
+
+                $vars[$nameSanitize]    = $_REQUEST[$nameMatched];
+            }
+        }
+
+        $input    = file_get_contents("php://input");
+        if(!empty($input)){
+            $pairs    = explode("&", $input);
+            foreach ($pairs as $pair) {
+                $nv                = explode("=", $pair);
+
+                $name            = urldecode($nv[0]);
+                $nameSanitize    = preg_replace('/([^\[]*)\[.*$/','$1',$name);
+
+                $nameMatched    = str_replace('.','_',$nameSanitize);
+                $nameMatched    = str_replace(' ','_',$nameMatched);
+
+                $vars[$nameSanitize]    = $_REQUEST[$nameMatched];
+            }
+        }
+
+        return $vars;
+    }
+}
+
 if( !isset( $args ) )
-    parse_str( file_get_contents('php://input'), $args );
+    $args = getRealREQUEST();
 
 if(!function_exists('parseURI'))
Index: sandbox/newExpressoMail/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- sandbox/newExpressoMail/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 6952)
+++ sandbox/newExpressoMail/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7266)
@@ -2460,6 +2460,7 @@
 				$append['folder_id'] = $vv['id'];
 				$append['folder_name'] = (($uid2cn && isset($vv['user'])) && ($cn = $this->ldap->uid2cn($vv['user']))) ? $cn : $vv['name'];
-				$status = imap_status($mboxStream, $vv['stream'], SA_UNSEEN); //Resgata Numero de mensagens não lidas
+				$status = imap_status($mboxStream, $vv['stream'], SA_ALL); //Resgata Numero de mensagens não lidas
 				$append['folder_unseen'] = isset($status->unseen) ? $status->unseen : 0 ;
+				$append['folder_total'] = isset($status->messages) ? $status->messages : 0 ;
 				$append['folder_hasChildren'] = (($vv['attributes'] == 32) && ($vv['name'] != 'INBOX')) ? 1 : 0;
 				$append['folder_parent'] = $vv['parent'];
@@ -2478,4 +2479,20 @@
 	}
     
+    function getFolderInfo($folder){
+        $folder = ($folder != '' ? $folder : 'INBOX');
+        $return = array();
+        $append = array();
+        $newFolder = mb_convert_encoding($folder, 'UTF7-IMAP','UTF-8, ISO-8859-1, UTF7-IMAP');
+        $serverString = "{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$newFolder;
+        $mboxStream = $this->open_mbox($folder); //abre conexão imap
+        $status = imap_status($mboxStream, $serverString , SA_ALL); //Resgata Numero de mensagens não lidas
+        $append['folder_id'] = $folder;
+        $append['folder_name'] = explode($this->imap_delimiter,$folder);
+        $append['folder_name'] = $append['folder_name'][count($append['folder_name'])-1];
+        $append['folder_unseen'] = isset($status->unseen) ? $status->unseen : 0 ;
+        $append['folder_total'] = isset($status->messages) ? $status->messages : 0 ;
+        $return[] = $append;
+        return $return;
+    }
 
 	function create_mailbox($arr)
@@ -2539,5 +2556,5 @@
 	function delete_mailbox($arr)
 	{
-		$namebox = $arr['del_past'];
+		$namebox = isset($arr['del_past']) ? $arr['del_past'] : $arr;
 		$imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer'];
 		$mbox_stream = $this->mbox ? $this->mbox : $this->open_mbox();
