Index: trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5605)
+++ trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5620)
@@ -2717,4 +2717,8 @@
                 //Compatibilização com Outlook, ao encaminhar a mensagem
                 $body = mb_ereg_replace('<!--\[', '<!-- [', $params['body']);
+                $body = str_replace("%nbsp;","&nbsp;",$body);
+                $body = preg_replace("/\n/"," ",$body);
+                $body = preg_replace("/\r/","" ,$body);
+                $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' );	
             }
 
@@ -2893,5 +2897,6 @@
                      else
                          $mailService->addStringAttachment(base64_decode($att['source']), $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' );
-
+                     
+                     $message_size_total += $att['size'];
                      unset($att);
                 }
@@ -2899,14 +2904,34 @@
                 {
                     $value = json_decode($value, true);
-                    $sub =  $value['name'] ? $value['name'].'.eml' :'no title.eml';
-                    $mbox_stream = $this->open_mbox($value['folder']);
-                    $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']);
-                    $mailService->addStringAttachment($rawmsg, $sub, 'message/rfc822', '7bit', 'attachment' );
-                    $message_size_total += mb_strlen($rawmsg); //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg.
-                    unset($rawmsg);
+
+                    switch ($value['type']) {
+                        case 'imapPart':
+                                $att = $this->getForwardingAttachment($value['folder'],$value['uid'], $value['part']);
+                                if(strstr($body,'<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />') !== false)//Embeded IMG
+                                {    
+                                    $body = str_ireplace('<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />' , '<img src="'.$att['name'].'" />', $body);
+                                    $mailService->addStringImage($att['source'], $att['type'], $att['name']);
+                                }
+                                else
+                                    $mailService->addStringAttachment($att['source'], $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' );
+                                 
+                                $message_size_total += $att['size']; //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg.
+                                unset($att);
+                            break;
+                            case 'imapMSG':
+                                $sub =  $value['name'] ? $value['name'].'.eml' :'no title.eml';
+                                $mbox_stream = $this->open_mbox($value['folder']);
+                                $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']);
+                                $mailService->addStringAttachment($rawmsg, $sub, 'message/rfc822', '7bit', 'attachment' );
+                                $message_size_total += mb_strlen($rawmsg); //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg.
+                                unset($rawmsg);
+                            break;
+
+                        default:
+                            break;
+                    }
                 }
-
             }
-
+	
             $message_size_total += strlen($params['body']);   /* Tamanho do corpo da mensagem. */        
 
@@ -3086,24 +3111,21 @@
 		return $bolean;
 	}
-
-	function get_forwarding_attachment($msg_folder, $msg_number, $msg_part, $encoding)
-	{
+        
+        function getForwardingAttachment($folder, $uid, $part, $rfc_822bodies = true , $info = true )
+        {
             include_once dirname(__FILE__).'/class.attachment.inc.php';
             $attachment = new attachment();
-			$attachment->decodeConf['rfc_822bodies'] = true; //Forçar a não decodificação de mensagens em anexo.
-            $attachment->setStructureFromMail($msg_folder, $msg_number);
-            return $attachment->getAttachment($msg_part);
-	}
-
-        function get_forwarding_attachment2($msg_folder, $msg_number, $msg_part, $encoding)
-	{
-            include_once dirname(__FILE__).'/class.attachment.inc.php';
-            $attachment = new attachment();
-            $attachment->setStructureFromMail($msg_folder, $msg_number);
-            $return = $attachment->getAttachmentInfo($msg_part);
-            $return['binary'] = $attachment->getAttachment($msg_part);
-            return $return;
-	}
-
+            $attachment->decodeConf['rfc_822bodies'] = $rfc_822bodies; //Forçar a não decodificação de mensagens em anexo.
+            $attachment->setStructureFromMail($folder, $uid);
+            
+            if($info === true)
+            {
+                $return = $attachment->getAttachmentInfo($part);
+                $return['source'] = $attachment->getAttachment($part);
+                return $return;
+            }
+            return $attachment->getAttachment($part);
+        }
+            
 	function del_last_caracter($string)
 	{
Index: trunk/expressoMail1_2/js/abas.js
===================================================================
--- trunk/expressoMail1_2/js/abas.js	(revision 5604)
+++ trunk/expressoMail1_2/js/abas.js	(revision 5620)
@@ -537,5 +537,5 @@
 	resizeWindow();
 	RichTextEditor.destroy( 'body_'+ID );
-        
+        delete msgAttachments[ID];
         //Caso for uma mensagem anexada tem que deletar ela da lixeira apos fechar a aba
             var isPartMsg = false;
@@ -598,5 +598,5 @@
         if(msgAttachments[ID][i] == att)
         {
-            msgAttachments[ID].splice(i,1);
+            delete msgAttachments[ID][i];
             break;
         }
Index: trunk/expressoMail1_2/js/main.js
===================================================================
--- trunk/expressoMail1_2/js/main.js	(revision 5619)
+++ trunk/expressoMail1_2/js/main.js	(revision 5620)
@@ -1538,14 +1538,6 @@
 			title = "Re: " + data.subject;
 			Element("subject_" + new_border_ID).value = "Re: " + data.subject;			
-
-			if (data.is_local_message){  
-				alert(get_lang("In the local file attachments, including images, will be disregarded. To forward / reply with the attachments, please first make the reopening of the message")+'.');  
-				var imagens = data.body.match(/<img[^>]*>/g);  
-				if(imagens != null)  
-					for (var x = 0; x < imagens.length; x++)  
-						data.body = data.body.replace(imagens[x],'');  
-			}else{
-				useOriginalAttachments(new_border_ID,border_ID);			
-			}      
+                        useOriginalAttachments(new_border_ID,border_ID);			
+			      
 
 			// Insert the signature automaticaly at message body if use_signature preference is set
@@ -1565,13 +1557,7 @@
 			Element("subject_" + new_border_ID).value = "Re: " + data.subject;
 			Element("to_" + new_border_ID).value = data.to;
-			if(data.is_local_message){
-				alert(get_lang("In the local file attachments, including images, will be disregarded. To forward / reply with the attachments, please first make the reopening of the message")+'.');  
-                var imagens = data.body.match(/<img[^>]*>/g);  
-                if(imagens != null)  
-					for (var x = 0; x < imagens.length; x++)  
-						data.body = data.body.replace(imagens[x],'');  
-			}else{
-				useOriginalAttachments(new_border_ID,border_ID);
-			}
+
+			useOriginalAttachments(new_border_ID,border_ID);
+			
 			block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour);
 			// Insert the signature automaticaly at message body if use_signature preference is set
@@ -1626,12 +1612,6 @@
 				}
 			}
-			if (data.is_local_message){  
-				alert(get_lang("In the local file attachments, including images, will be disregarded. To forward / reply with the attachments, please first make the reopening of the message")+'.');  
-                var imagens = data.body.match(/<img[^>]*>/g);  
-                if(imagens != null)  
-					for (var x = 0; x < imagens.length; x++)  
-						data.body = data.body.replace(imagens[x],'');  
-                     }      
-                else useOriginalAttachments(new_border_ID,border_ID);  
+                        
+                        useOriginalAttachments(new_border_ID,border_ID);  
 
 			// Insert the signature automaticaly at message body if use_signature preference is set
@@ -1683,5 +1663,5 @@
 			}
 			document.getElementById("subject_" + new_border_ID).value = "Re: " + data.subject;
-			useOriginalAttachments(new_border_ID,border_ID,data.is_local_message);
+			useOriginalAttachments(new_border_ID,border_ID);
 			block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour);
 			// Insert the signature automaticaly at message body if use_signature preference is set
@@ -1706,69 +1686,53 @@
 			document.getElementById("subject_" + new_border_ID).value = "Fw: " + data.subject;
 			var divFiles = Element("divFiles_"+new_border_ID);
+			var campo_arquivo;
+                  
+			if (Element("attachments_" + border_ID))
+                        {
+                            
+                                var fileUploadMSG = $('#fileupload_msg'+new_border_ID);
+				var attachments = document.getElementById("attachments_" + border_ID).getElementsByTagName("a");			
+				for (var i = 0; i < attachments.length; i++){
+					if((attachments[i].tagName=="SPAN") || (attachments[i].tagName=="IMG") || ((attachments[i].href.indexOf("javascript:download_local_attachment")==-1)&&(attachments[i].href.indexOf("javascript:download_attachments")==-1)))
+						continue;
+                                      
+                                            var arrayAtt = attachments[i].href.replace("javascript:download_attachments(", "").replace(")", "").split(',');                                 
+                                            var att = new Object();
+                                            var regex = new RegExp( "'", "g" );
+                                            att.folder = arrayAtt[0].replace(regex,"");
+                                            att.uid = arrayAtt[1].replace(regex,"");
+                                            att.part = arrayAtt[3].replace(regex,"");
+                                            att.type = 'imapPart';
+                                            var idATT = JSON.stringify(att);
+                                            addAttachment( new_border_ID , idATT);  
+
+                                            var attach = {};
+                                            attach.fileName = arrayAtt[5].replace(regex,"");
+                                            
+                                            if(attach.fileName.length > 10)
+                                                attach.fileName = attach.fileName.substr(0, 18) + "..." + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+                            
+                                            attach.fileSize =  attachments[i].text.substring(( attachments[i].text.lastIndexOf('(')+1), attachments[i].text.lastIndexOf(')'));
+                                            
+                                            var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
+                                            upload.find('.status-upload').remove();
+                                            upload.find('.in-progress').remove(); 
+                                            upload.find('p').append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
+                                            fileUploadMSG.find('.attachments-list').append(upload);
+			        					
+				}
+                                $('.attachments-list').find('.button.close').button({
+					icons: {
+						primary: "ui-icon-close"
+					},
+					text: false
+				}).click(function(){
+					var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+					fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]');
+                                        delAttachment(new_border_ID,idAttach); 
+					$(this).parent().remove();
+				});	
+			}
 			
-			
-			if (data.is_local_message) {//Local messages  
-				document.getElementById("is_local_forward"+new_border_ID).value = "1";  
-                alert(get_lang("In the local file attachments, including images, will be disregarded. To forward / reply with the attachments, please first make the reopening of the message")+'.');  
-                var imagens = data.body.match(/<img[^>]*>/g);  
-                if(imagens != null)  
-					for (var x = 0; x < imagens.length; x++)  
-						data.body = data.body.replace(imagens[x],'');    
-                    }
-                else{  
-
-			
-			
-			var campo_arquivo;
-                        
-			if (Element("attachments_" + border_ID)){
-				var attachments = document.getElementById("attachments_" + border_ID).getElementsByTagName("a");
-				
-				for (var i = 0; i < attachments.length; i++){
-					if((attachments[i].tagName=="SPAN") || (attachments[i].tagName=="IMG") ||
-							((attachments[i].href.indexOf("javascript:download_local_attachment")==-1)&&(attachments[i].href.indexOf("javascript:download_attachments")==-1)))
-						continue;
-					var link_attachment = document.createElement("A");
-					link_attachment.setAttribute("href", attachments[i].href);
-					link_attachment.innerHTML = attachments[i].firstChild.nodeValue + '<br/>';
-
-					if (data.is_local_message) {//Local messages
-						document.getElementById("is_local_forward"+new_border_ID).value = "1";
-						var tmp = link_attachment.href.substring(link_attachment.href.indexOf("(") + 2);//Pula o parenteses e a aspas
-						tmp = tmp.substring(0, tmp.length - 2);//corta a aspas e o parenteses
-						tmp = replaceAll(tmp,"%20"," ");
-						if (!tmp.match(/inc\/gotodownload.php/)) { //Anexos após ticket #1257 que usa gotodownload
-							var tempNomeArquivo = tmp.split("/");
-							var nomeArquivo = tempNomeArquivo[tempNomeArquivo.length - 1];
-						}
-						else {
-							var tempNomeArquivo = tmp.split("&newfilename=");
-							var nomeArquivo = tempNomeArquivo[tempNomeArquivo.length - 1];
-						}
-
-						if(nomeArquivo.match(/\.[a-z]{1,3}\.php$/i)!=null) //Anexos no gears podem vir com .php depois de sua extensão. tenho que tirar o .php para ficar o nome real do arquivo.
-							nomeArquivo = nomeArquivo.substring(0, nomeArquivo.length - 4);
-						campo_arquivo = addForwardedFile(new_border_ID, nomeArquivo, link_attachment.href);
-							
-						if(!expresso_offline)
-							expresso_local_messages.getInputFileFromAnexo(campo_arquivo, tmp);
-						else //To offline, you just set the url on value of a hidden input.
-							campo_arquivo.value = tmp;
-
-					}
-					else {
-						var tmp = link_attachment.href.replace("javascript:download_attachments(", "").replace(")", "");
-						var a_tmp = tmp.split(',');
-						tmp = link_attachment.innerHTML.substring(0,link_attachment.innerHTML.lastIndexOf("("));
-						a_tmp[2] = "'"+tmp.substring(0,tmp.length-1)+"'";
-						s_tmp = trim(escape(connector.serialize(a_tmp)));
-
-						divFiles.innerHTML += "<input style='border:0' type='CHECKBOX' name='forwarding_attachments[]' checked value=\""+s_tmp+"\"/>";
-						divFiles.innerHTML += "<link style='border:0' name='file_"+i+"' id='inputFile_"+border_ID+i+"'/>";
-						divFiles.appendChild(link_attachment);
-					}
-				}
-			}
-			}
 			// Insert the signature automaticaly at message body if use_signature preference is set
 			if (preferences.use_signature == "1")  
@@ -1865,23 +1829,49 @@
 			}
 
-			var divFiles = Element("divFiles_"+new_border_ID);
-			if (Element("attachments_" + border_ID)){
-				var attachments = document.getElementById("attachments_" + border_ID).childNodes;
-				for (var i = (attachments.length > 1 ? 1 : 0); i < attachments.length; i++){
-					var link_attachment = document.createElement("A");
-					link_attachment.setAttribute("href", attachments[i].href);
-					if(attachments[i].innerHTML == "")
-                                            continue;
-                                        else
-                                            link_attachment.innerHTML = attachments[i].innerHTML;
-					var tmp = link_attachment.href.replace("javascript:download_attachments(", "").replace(")", "");
-					var a_tmp = tmp.split(',');
-					tmp = link_attachment.innerHTML.substring(0,link_attachment.innerHTML.lastIndexOf("("));
-					a_tmp[2] = "'"+tmp.substring(0,tmp.length-1)+"'";
-					s_tmp = escape(connector.serialize(a_tmp));
-
-					divFiles.innerHTML += "<input style='border:0' type='CHECKBOX' name='forwarding_attachments[]' checked value=\""+s_tmp+"\"/>";
-					divFiles.appendChild(link_attachment);
+			if (Element("attachments_" + border_ID))
+                        {
+                            
+                                var fileUploadMSG = $('#fileupload_msg'+new_border_ID);
+				var attachments = document.getElementById("attachments_" + border_ID).getElementsByTagName("a");			
+				for (var i = 0; i < attachments.length; i++){
+					if((attachments[i].tagName=="SPAN") || (attachments[i].tagName=="IMG") || ((attachments[i].href.indexOf("javascript:download_local_attachment")==-1)&&(attachments[i].href.indexOf("javascript:download_attachments")==-1)))
+						continue;
+                                      
+                                            var arrayAtt = attachments[i].href.replace("javascript:download_attachments(", "").replace(")", "").split(',');                                 
+                                            var att = new Object();
+                                            var regex = new RegExp( "'", "g" );
+                                            att.folder = arrayAtt[0].replace(regex,"");
+                                            att.uid = arrayAtt[1].replace(regex,"");
+                                            att.part = arrayAtt[3].replace(regex,"");
+                                            att.type = 'imapPart';
+                                            var idATT = JSON.stringify(att);
+                                            addAttachment( new_border_ID , idATT);  
+
+                                            var attach = {};
+                                            attach.fileName = arrayAtt[5].replace(regex,"");
+                                            
+                                            if(attach.fileName.length > 10)
+                                                attach.fileName = attach.fileName.substr(0, 18) + "..." + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+                            
+                                            attach.fileSize =  attachments[i].text.substring(( attachments[i].text.lastIndexOf('(')+1), attachments[i].text.lastIndexOf(')'));
+                                            
+                                            var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
+                                            upload.find('.status-upload').remove();
+                                            upload.find('.in-progress').remove(); 
+                                            upload.find('p').append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
+                                            fileUploadMSG.find('.attachments-list').append(upload);
+			        					
 				}
+                                $('.attachments-list').find('.button.close').button({
+					icons: {
+						primary: "ui-icon-close"
+					},
+					text: false
+				}).click(function(){
+					var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+					fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]');
+                                        delAttachment(new_border_ID,idAttach); 
+					$(this).parent().remove();
+				});	
 			}
 			RichTextEditor.setInitData(new_border_ID, data.body, 'edit');
@@ -1945,53 +1935,52 @@
 }
 
-function useOriginalAttachments(new_id_border,old_id_border,is_local)
+function useOriginalAttachments(new_border_ID,old_id_border)
 {
-	var divFiles = Element("divFiles_"+new_id_border);
-	if (Element("attachments_" + old_id_border)) {
-		var areaOldAttachments = document.createElement("DIV");
-		areaOldAttachments.id = "area_div_attachments_"+new_id_border;
-		divFiles.appendChild(areaOldAttachments);
-		var optAttachments = document.createElement("A");
-		optAttachments.setAttribute("href","javascript:void(0)");
-		optAttachments.tabIndex = -1;
-		optAttachments.innerHTML = get_lang("Original attachments: add")+"</br>";
-		areaOldAttachments.appendChild(optAttachments);
-		var divOriginalAttachments = document.createElement("DIV");
-		divOriginalAttachments.id = "div_attachments_"+new_id_border;
-		optAttachments.onclick = function(){
-			if(document.getElementById('div_attachments_'+new_id_border))
-			{
-				areaOldAttachments.removeChild(document.getElementById('div_attachments_'+new_id_border));
-				optAttachments.innerHTML = get_lang("Original attachments: add")+"</br>";
-			}
-			else
-			{
-				areaOldAttachments.appendChild(divOriginalAttachments);
-				optAttachments.innerHTML = get_lang("Original attachments: remove")+"</br>";
-			}
-			return false;};
-			var attachments = document.getElementById("attachments_" + old_id_border).getElementsByTagName("a");
-			for (var i = (attachments.length > 1 ? 1 : 0); i < attachments.length; i++){
-				if (!is_local) {
-					var link_attachment = document.createElement("A");
-					link_attachment.setAttribute("href", attachments[i].href);
-					link_attachment.innerHTML = attachments[i].firstChild.nodeValue + '<br/>';
-					var tmp = link_attachment.href.replace("javascript:download_attachments(", "").replace(")", "");
-					var a_tmp = tmp.split(',');
-					tmp = link_attachment.innerHTML.substring(0,link_attachment.innerHTML.lastIndexOf("("));
-					a_tmp[2] = "'"+tmp.substring(0,tmp.length-1)+"'";
-					s_tmp = trim(escape(connector.serialize(a_tmp)));
-					divOriginalAttachments.innerHTML += "<input style='border:0' type='CHECKBOX' name='forwarding_attachments[]' checked value=\""+s_tmp+"\"/>";
-					divOriginalAttachments.appendChild(link_attachment);
-				}
-				else {
-					document.getElementById("is_local_forward"+new_id_border).value = "1";
-					var link = attachments[i].href.replace("javascript:download_local_attachment('", "").replace("')", "");
-					var name = attachments[i].innerHTML.substring(0, attachments[i].innerHTML.lastIndexOf("("));
-					var campo_arquivo = addForwardedFile(new_id_border, name, attachments[i].href, divOriginalAttachments);
-					expresso_local_messages.getInputFileFromAnexo(campo_arquivo, link);
-				}
-			}
-	}
+	if (Element("attachments_" + old_id_border))
+        {
+                var fileUploadMSG = $('#fileupload_msg'+new_border_ID);
+                var attachments = document.getElementById("attachments_" + old_id_border).getElementsByTagName("a");			
+                for (var i = 0; i < attachments.length; i++){
+                        if((attachments[i].tagName=="SPAN") || (attachments[i].tagName=="IMG") || ((attachments[i].href.indexOf("javascript:download_local_attachment")==-1)&&(attachments[i].href.indexOf("javascript:download_attachments")==-1)))
+                                continue;
+
+                            var arrayAtt = attachments[i].href.replace("javascript:download_attachments(", "").replace(")", "").split(',');                                 
+                            var att = new Object();
+                            var regex = new RegExp( "'", "g" );
+                            att.folder = arrayAtt[0].replace(regex,"");
+                            att.uid = arrayAtt[1].replace(regex,"");
+                            att.part = arrayAtt[3].replace(regex,"");
+                            att.type = 'imapPart';
+                            var idATT = JSON.stringify(att);
+                            addAttachment( new_border_ID , idATT);  
+
+                            var attach = {};
+                            attach.fileName = arrayAtt[5].replace(regex,"");
+
+                            if(attach.fileName.length > 10)
+                                attach.fileName = attach.fileName.substr(0, 18) + "..." + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+
+                            attach.fileSize =  attachments[i].text.substring(( attachments[i].text.lastIndexOf('(')+1), attachments[i].text.lastIndexOf(')'));
+
+                            var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
+                            upload.find('.status-upload').remove();
+                            upload.find('.in-progress').remove(); 
+                            upload.find('p').append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
+                            fileUploadMSG.find('.attachments-list').append(upload);
+
+                }
+                $('.attachments-list').find('.button.close').button({
+                        icons: {
+                                primary: "ui-icon-close"
+                        },
+                        text: false
+                }).click(function(){
+                        var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+                        fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]');
+                        delAttachment(new_border_ID,idAttach); 
+                        $(this).parent().remove();
+                });	
+        }
+	
 }
 
@@ -2168,5 +2157,5 @@
         var onClick = save_link.onclick;
 	save_link.onclick = '';
-	$("#save_message_options_"+ID).button({ disabled: true });
+	$("#save_message_options_"+ID).button({disabled: true});
 
 	ID_tmp = ID;
@@ -3572,5 +3561,5 @@
 		var res = $.map(evtObj, function( form){
 			return [$.map(form.files , function( files){
-					return { source: files , disposition : form['attDisposition'+form.abaID]};
+					return {source: files , disposition : form['attDisposition'+form.abaID]};
 				})];
 		});
Index: trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- trunk/expressoMail1_2/js/draw_api.js	(revision 5619)
+++ trunk/expressoMail1_2/js/draw_api.js	(revision 5620)
@@ -4265,4 +4265,5 @@
                                                         att.foder = folder_name;
                                                         att.uid = message_number;
+                                                        att.type = 'imapMSG';
                                                         att.name = onceOpenedMessages[folder_name][message_number].subject + '.eml';
                                                         var idATT = JSON.stringify(att);
