Index: branches/2.2/expressoMail1_2/js/common_functions.js
===================================================================
--- branches/2.2/expressoMail1_2/js/common_functions.js	(revision 3380)
+++ branches/2.2/expressoMail1_2/js/common_functions.js	(revision 3387)
@@ -240,6 +240,7 @@
 }
 //ADD forwarded files
-function addForwardedFile(id_border,file_name,link){
-	divFiles = document.getElementById("divFiles_"+id_border);
+function addForwardedFile(id_border,file_name,link,divFiles){
+	if(!divFiles)
+		divFiles = document.getElementById("divFiles_"+id_border);
 
 	if (! divFiles)
Index: branches/2.2/expressoMail1_2/js/main.js
===================================================================
--- branches/2.2/expressoMail1_2/js/main.js	(revision 3372)
+++ branches/2.2/expressoMail1_2/js/main.js	(revision 3387)
@@ -965,10 +965,12 @@
 		preferences.signature = "";
 	var signature = preferences.type_signature == 'html' ? preferences.signature : preferences.signature.replace(/\n/g, "<br>");
+	if(type!="new" && type!="edit")
+		data.is_local_message = (document.getElementById("is_local_"+border_ID).value=="1")?true:false;
 	switch(type){
 		case "reply_without_history":
 			Element("to_" + new_border_ID).value = data.to;
 			title = "Re: " + data.subject;
-			Element("subject_" + new_border_ID).value = "Re: " + data.subject;
-			useOriginalAttachments(new_border_ID,border_ID);
+			Element("subject_" + new_border_ID).value = "Re: " + data.subject;			
+			useOriginalAttachments(new_border_ID,border_ID,data.is_local_message);
 			var body = Element("body_" + new_border_ID);
 			body.contentWindow.document.open();
@@ -1006,5 +1008,5 @@
 			Element("subject_" + new_border_ID).value = "Re: " + data.subject;
 			Element("to_" + new_border_ID).value = data.to;
-			useOriginalAttachments(new_border_ID,border_ID);
+			useOriginalAttachments(new_border_ID,border_ID,data.is_local_message);
 			block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour);
 			var body = Element("body_" + new_border_ID);
@@ -1060,5 +1062,5 @@
 				Element('space_link_' + new_border_ID).style.display='none';
 			}
-			useOriginalAttachments(new_border_ID,border_ID);
+			useOriginalAttachments(new_border_ID,border_ID,data.is_local_message);
 			var body = Element("body_" + new_border_ID);
 			body.contentWindow.document.open();
@@ -1112,5 +1114,5 @@
 			}
 			document.getElementById("subject_" + new_border_ID).value = "Re: " + data.subject;
-			useOriginalAttachments(new_border_ID,border_ID);
+			useOriginalAttachments(new_border_ID,border_ID,data.is_local_message);
 			block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour);
 			var body = document.getElementById("body_" + new_border_ID);
@@ -1372,5 +1374,5 @@
 }
 
-function useOriginalAttachments(new_id_border,old_id_border)
+function useOriginalAttachments(new_id_border,old_id_border,is_local)
 {
 	var divFiles = Element("divFiles_"+new_id_border);
@@ -1400,14 +1402,23 @@
 			var attachments = document.getElementById("attachments_" + old_id_border).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);
-				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 = 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);
+				if (!is_local) {
+					var link_attachment = document.createElement("A");
+					link_attachment.setAttribute("href", attachments[i].href);
+					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 = 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);
+				}
 			}
 	}
