Index: sandbox/2.5.0-expresso1/prototype/modules/mail/js/foldertree.js
===================================================================
--- sandbox/2.5.0-expresso1/prototype/modules/mail/js/foldertree.js	(revision 7270)
+++ sandbox/2.5.0-expresso1/prototype/modules/mail/js/foldertree.js	(revision 7340)
@@ -575,6 +575,6 @@
                     var name_box = $(this).parents("li:first").attr("id");
 
-
                     var name_folder = name_box.split(cyrus_delimiter)[name_box.split(cyrus_delimiter).length-1];
+
 
                     var hand_export = function(data){
@@ -590,28 +590,6 @@
                           var msgsArchive = expresso_mail_archive.messageslisted;
                         
-                          var array = new Array();
-
-                          for(var i =0; i < msgsArchive.length; i++){
-                            eachMsg = {
-                                    'ContentType' : msgsArchive[i].ContentType,
-                                    'from' : { 'email' : msgsArchive[i].from.email, 'full' : msgsArchive[i].from.full, 'name' : msgsArchive[i].from.name},
-                                    'msg_sample' : msgsArchive[i].msg_sample,
-                                    'subject' : msgsArchive[i].subject,
-                                    'to' : { 'email' : msgsArchive[i].to.email, 'full' : msgsArchive[i].to.full, 'name' : msgsArchive[i].to.name},
-                                    'toaddress2' : msgsArchive[i].toaddress2,
-                                    'msg_number' : msgsArchive[i].msg_number,
-                                    'date' : new Date(msgsArchive[i].timestamp).toString()  
-                            };
-                            array.push(eachMsg);
-
-                          }
-
-                            $.ajax({
-                              type: "POST",
-                              url: "controller.php?action=$this.exporteml.export_all_byLocalFolder",
-                              data: { folder: name_box, type: "msg_local", messages : array}
-                              }).done(function(msg) {
-                                hand_export(msg.split('"')[1]);
-                              });
+                           buildExportArchiver(msgsArchive, name_box);
+
                     } else {
                           cExecute("$this.exporteml.export_all",hand_export,"folder="+name_box);  
Index: sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js
===================================================================
--- sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js	(revision 7334)
+++ sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js	(revision 7340)
@@ -1583,5 +1583,18 @@
     }
 }
-    
+
+
+
+MailArchiver.prototype.getSomeMsgs = function(msgIds){
+    try{
+       expresso_mail_archive.getSomeMsg = new Array();
+       for(var i=0; i < msgIds.length; i++){
+           expresso_mail_archive.getSomeMsg.push(expresso_mail_archive.getMessageHeaders(msgIds[i]));
+       }
+       
+   }catch(e){
+
+   }
+} 
 
 MailArchiver.prototype.getMessage = function(msgdata){
Index: sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js
===================================================================
--- sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js	(revision 7320)
+++ sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js	(revision 7340)
@@ -3907,7 +3907,54 @@
 }
 
+function buildExportArchiver(msgsArchive, name_box){
+
+    var hand_export = function(data){
+        if(!data){
+            write_msg(get_lang('Error compressing messages (ZIP). Contact the administrator.'))
+        }else if(data["empty_folder"] || data == "empty_folder"){
+            write_msg(get_lang("The selected folder is empty."));
+        }else
+          download_attachments(null, null, data, null,null, get_current_folder().split("_")[2] +'.zip');
+    }
+
+    var array = new Array();
+
+    for(var i =0; i < msgsArchive.length; i++){
+        eachMsg = {
+                'ContentType' : msgsArchive[i].ContentType,
+                'from' : { 'email' : msgsArchive[i].from.email, 'full' : msgsArchive[i].from.full, 'name' : msgsArchive[i].from.name},
+                'msg_sample' : msgsArchive[i].msg_sample,
+                'subject' : msgsArchive[i].subject,
+                'to' : { 'email' : msgsArchive[i].to.email, 'full' : msgsArchive[i].to.full, 'name' : msgsArchive[i].to.name},
+                'toaddress2' : msgsArchive[i].toaddress2,
+                'msg_number' : msgsArchive[i].msg_number,
+                'date' : new Date(msgsArchive[i].timestamp).toString()  
+        };
+        array.push(eachMsg);
+    }
+
+    $.ajax({
+        type: "POST",
+        url: "controller.php?action=$this.exporteml.export_all_byLocalFolder",
+        data: { folder: name_box, type: "msg_local", messages : array}
+    }).done(function(msg) {
+        hand_export(msg.split('"')[1]);
+    });
+}
 
 function export_all_selected_msgs(){
-	if (openTab.type[currentTab] > 1){	    
+	if(get_current_folder().split("_")[0] == "local"){
+
+        if(get_selected_messages().indexOf(",") != -1){
+            expresso_mail_archive.getSomeMsgs(get_selected_messages().split(","));
+        } else {
+            expresso_mail_archive.getSomeMsgs([get_selected_messages()]);
+        }
+        
+        buildExportArchiver(expresso_mail_archive.getSomeMsg, get_current_folder().split("_")[2]);
+
+    } else {
+
+    if (openTab.type[currentTab] > 1){	    
 		source_msg(currentTab,openTab.imapBox[currentTab]);
 		return;
@@ -3955,4 +4002,5 @@
 	else
 		write_msg(get_lang('No selected message.'));
+    }
 }
 
Index: sandbox/2.5.0-expresso1/expressoMail1_2/js/messages_controller.js
===================================================================
--- sandbox/2.5.0-expresso1/expressoMail1_2/js/messages_controller.js	(revision 7334)
+++ sandbox/2.5.0-expresso1/expressoMail1_2/js/messages_controller.js	(revision 7340)
@@ -832,14 +832,13 @@
 
     messages_proxy.prototype.export_all_messages = function(folder){
-
-		if (!folder){
-			folder = get_current_folder();
-		}
-
-		if(!this.is_local_folder(folder)){
-			export_all_selected_msgs();
-		}else{
-			local_messages.prototype.local_messages_to_export();
-		}
+        if (!folder) {
+            folder = get_current_folder();
+        }
+
+        if(!this.is_local_folder(folder) || folder.split("_")[0] == "local"){
+            export_all_selected_msgs();
+        }else{
+            local_messages.prototype.local_messages_to_export();
+        }
 	}
 	
