Index: sandbox/2.4.2-expresso3/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- sandbox/2.4.2-expresso3/expressoMail1_2/inc/class.exporteml.inc.php	(revision 5934)
+++ sandbox/2.4.2-expresso3/expressoMail1_2/inc/class.exporteml.inc.php	(revision 6745)
@@ -16,5 +16,5 @@
 	var $mbox_stream;
 	var $tempDir;
-	
+
 	function ExportEml() {
 	   
@@ -214,5 +214,4 @@
 		// se encontram em um mesmo folder
 		if (count($sorted_msgs)==1){
-							
 			$array_names_keys = array_keys($sorted_msgs);
 			$this->folder = mb_convert_encoding($array_names_keys[0], "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP");
@@ -228,10 +227,15 @@
 				$fileName       = $this->CreateFileEml($sEMLData, $tempDir, $msg_number[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]);
 		
-				
+				$header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $msg_number[0]), 80, 255);
+            	$subject = $this->decode_subject($header->fetchsubject);
+
 				imap_close($this->mbox_stream);
 				if (!$fileName) {
 					return false;
 				}else{
-					return $tempDir.'/'.$fileName;
+					$return = array();
+					$return[] = $tempDir.'/'.$fileName;
+					$return[] = $subject;
+					return $return;
 				}
 			}
@@ -271,5 +275,5 @@
 			}
 
-			return $file;
+			return $file;			
 		
 		//exporta mensagens de diferentes pastas
@@ -362,5 +366,4 @@
 				$file = false;
 			}
-
             return $file;
 		
@@ -369,5 +372,5 @@
 		{
 			$this-> folder = $params['folder'];
-				$this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP");
+			$this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP");
 			$array_ids = explode(',', $params['msgs_to_export']);
 			$error = False;
@@ -383,4 +386,7 @@
 				$sEMLData       = $this->parseEml($header, $body);                     
 				$fileName       = $this->CreateFileEml($sEMLData, $tempDir, $array_ids[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]);
+			
+				$header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $array_ids[0]), 80, 255);
+	            $subject = $this->decode_subject($header->fetchsubject);
 
 				imap_close($this->mbox_stream);
@@ -388,5 +394,8 @@
 					return false;
 				} else {
-					return $tempDir.'/'.$fileName;
+					$return = array();
+					$return[] = $tempDir.'/'.$fileName;
+					$return[] = $subject;
+					return $return;
 				}
 			}
@@ -424,5 +433,4 @@
 				$file = false;
 			}
-
 			return $file;
 		}
@@ -453,9 +461,15 @@
 			$fileName       = $this->CreateFileEml($sEMLData, $tempDir, $array_ids[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]);
 
+			$header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $array_ids[0]), 80, 255);
+            $subject = $this->decode_subject($header->fetchsubject);
+
 			imap_close($this->mbox_stream);
 			if (!$fileName) {
 				return false;
 			} else {
-				return $tempDir.'/'.$fileName;
+				$return = array();
+				$return[] = $tempDir.'/'.$fileName;
+				$return[] = $subject;
+				return $return;
 			}
 		}
Index: sandbox/2.4.2-expresso3/expressoMail1_2/js/common_functions.js
===================================================================
--- sandbox/2.4.2-expresso3/expressoMail1_2/js/common_functions.js	(revision 6707)
+++ sandbox/2.4.2-expresso3/expressoMail1_2/js/common_functions.js	(revision 6745)
@@ -825,5 +825,5 @@
 	var num_msg = id_msg.substr(0,(id_msg.length - 2));
 	var handler_source = function(data){
-		download_attachments(null, null, data, null,null,'fonte_da_mensagem.eml');
+		download_attachments(null, null, data[0], null,null,data[1]+'.eml');
 	}
 	cExecute("$this.exporteml.export_msg",handler_source,"folder="+url_decode(folder)+"&msgs_to_export="+num_msg);
Index: sandbox/2.4.2-expresso3/expressoMail1_2/js/main.js
===================================================================
--- sandbox/2.4.2-expresso3/expressoMail1_2/js/main.js	(revision 6721)
+++ sandbox/2.4.2-expresso3/expressoMail1_2/js/main.js	(revision 6745)
@@ -3485,6 +3485,6 @@
 		else{
 			var filename = 'mensagens.zip'; 
-			if (data.match(/\.eml$/gi)) { 
-	                        filename = 'fonte_da_mensagem.eml'; 
+			if (data[0].match(/\.eml$/gi)) { 
+                filename = data[1]+'.eml'; 
 			} 
 			download_attachments(null, null, data, null,null,filename);
