Index: sandbox/2.5.0-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- sandbox/2.5.0-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7184)
+++ sandbox/2.5.0-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7189)
@@ -4751,5 +4751,53 @@
 
     function unarchive_mail($params)
-    {		
+    {	
+        $dest_folder = urldecode($params['folder']);
+        $sources = explode("#@#@#@",$params['source']);
+        $timestamps = explode("#@#@#@",$params['timestamp']);
+        $flags = explode("#@#@#@",$params['flags']);
+        $ids = explode("#@#@#@",$params['id']);
+        $return = array();
+        $archived = array();
+        $error = array();
+
+        foreach($sources as $index=>$src)
+        {
+            if($src!="")
+            {
+                //If it is a MailArchiver incomming data
+                if($params['madata'])
+                    $sourcedec = utf8_decode($src);
+                //Default data
+                else
+                    $sourcedec = $src;
+
+		 		$source = $this->treat_base64_from_post($sourcedec);
+				$insert = $this->insert_email($source,$dest_folder,$timestamps[$index],$flags[$index]);
+				
+                if($insert['error'])
+                {
+                    $error[] = $ids[$index];
+                }
+                else 
+                {
+                    $archived[] = $ids[$index];
+                }
+            }else{
+                $error[] = $ids[$index];
+            }
+		}
+        
+        if (!empty($error))
+        {
+            $return['error'] = $error;
+        }
+        if (!empty($archived))
+        {
+            $return['archived'] = $archived;
+        }
+        
+        return $return;
+
+    	/*	
         $dest_folder = $params['folder'];
         $sources = explode("#@#@#@",$params['source']);
@@ -4766,6 +4814,7 @@
  		        $insert = $this->insert_email($source, mb_convert_encoding( $dest_folder,"ISO-8859-1","UTF-8"), $timestampsactual,$flags[$index]); 
             }
-	}
+		}
         return $insert;
+    	*/
     }
 
@@ -5457,6 +5506,6 @@
             return(false);
           
-        $a = imap_msgno($this->mbox, $msg_n);          
-        $header = @imap_headerinfo($this->mbox, $a, 80, 255);
+        $msgno_imap = imap_msgno($this->mbox, $msg_n);          
+        $header = @imap_headerinfo($this->mbox, $msgno_imap, 80, 255);
 		
         if (!is_object($header))
Index: sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js
===================================================================
--- sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js	(revision 7184)
+++ sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js	(revision 7189)
@@ -559,5 +559,8 @@
 MailArchiver.prototype.unarchieve = function (folder, new_folder, msgs_number){
     try{ 
-        document.getElementById('main_title').innerHTML = get_lang("Starting to unarchive messages");
+        //Marcosw inicio - Melhoria na exibição de mensagem
+        //document.getElementById('main_title').innerHTML = get_lang("Starting to unarchive messages");
+        write_msg(get_lang("Starting to unarchive messages"));
+        //Marcosw fim
         if(currentTab.toString().indexOf("_r") != -1){
             msgs_number = currentTab.toString().substr(0,currentTab.toString().indexOf("_r"));
@@ -573,5 +576,10 @@
                 expresso_mail_archive.unarchivecounter = 0;
                 expresso_mail_archive.unarchive_error_counter=0;
-                expresso_mail_archive.getFolderInfo(folder.substr(6, folder.length));
+
+                //Marcosw início - correção de inconsistência com o nome da pasta local
+                //expresso_mail_archive.getFolderInfo(folder.substr(6, folder.length));
+                expresso_mail_archive.getFolderInfo(folder.replace("local_messages",""));
+                //Marcosw fim
+
                 expresso_mail_archive.unarchievefolder = expresso_mail_archive.folder.name;
                 (new_folder != null)?expresso_mail_archive.unarchievenewfolder = new_folder:expresso_mail_archive.unarchievenewfolder='INBOX';
@@ -677,11 +685,17 @@
                 expresso_mail_archive.unarchieveController(data);
             }
-            //write_msg(get_lang('Unarchiving message %1 of %2', (expresso_mail_archive.unarchivecounter + 1), expresso_mail_archive.message_list.length));
-            document.getElementById('main_title').innerHTML = get_lang('Unarchiving message %1 of %2', (expresso_mail_archive.unarchivecounter + 1), expresso_mail_archive.message_list.length);
+            //Marcosw inicio - Melhoria na exibição de mensagem
+            //document.getElementById('main_title').innerHTML = get_lang('Unarchiving message %1 of %2', (expresso_mail_archive.unarchivecounter + 1), expresso_mail_archive.message_list.length);
+            write_msg(get_lang('Unarchiving message %1 of %2', (expresso_mail_archive.unarchivecounter + 1), expresso_mail_archive.message_list.length));
+            //Marcosw fim
+            
             cExecute ("$this.imap_functions.unarchive_mail&", handler_unarchive, params);
 
         }
         
-        document.getElementById('main_title').innerHTML = get_lang('Opening message %1 to unarchive', (expresso_mail_archive.unarchivecounter + 1));
+        //Marcosw inicio - Melhoria na exibição de mensagem
+        //document.getElementById('main_title').innerHTML = get_lang('Opening message %1 to unarchive', (expresso_mail_archive.unarchivecounter + 1));
+        write_msg(get_lang('Opening message %1 to unarchive', (expresso_mail_archive.unarchivecounter + 1)));
+        //Marcosw fim
     
         UnarchiveReqHandler.handler.open("GET", email, true);
