Index: /branches/2.2/mobile/inc/class.mobiletemplate.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 3996)
+++ /branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 4046)
@@ -184,11 +184,16 @@
 
 				$built_current_url = $this->build_url($current_url, $current_params);
-
-				//se der reload não vai gravar a url e vai sobreescrever o link do botão voltar para não voltar para a mesma página
-				if(str_replace("&is_back_link=true","",$built_current_url) != str_replace("&is_back_link=true","",$this->href_back))
-					$trace[sizeof($trace)] = array("url" => $current_url, "request" => $current_params);
-				else {
-					if($trace_idx >= 1) $trace_idx--;
-					$this->href_back = $this->build_url($trace[$trace_idx]["url"], $trace[$trace_idx]["request"]);
+				
+				if( (preg_match('/menuaction/i',$built_current_url) 
+				&& !preg_match('/mobile\.ui_mobilemail\.(send_mail|save_draft|delete_msg)/i',$built_current_url) )
+				&& !$current_params["ignore_trace_url"] ) {
+
+					//se der reload não vai gravar a url e vai sobreescrever o link do botão voltar para não voltar para a mesma página
+					if(str_replace("&is_back_link=true","",$built_current_url) != str_replace("&is_back_link=true","",$this->href_back))
+						$trace[sizeof($trace)] = array("url" => $current_url, "request" => $current_params);
+					else {
+						if($trace_idx >= 1) $trace_idx--;
+						$this->href_back = $this->build_url($trace[$trace_idx]["url"], $trace[$trace_idx]["request"]);
+					}
 				}
 			} else {
Index: /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 4040)
+++ /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 4046)
@@ -843,5 +843,5 @@
 				$this->new_msg( $params );
 			}else {
-				header('Location: index.php?menuaction=menuaction=mobile.ui_home.index&success_message='.lang("draft saved"));
+				header('Location: index.php?menuaction=menuaction=mobile.ui_home.index&success_message='.lang("draft saved").'&ignore_trace_url=true');
 			}
 		}
@@ -952,7 +952,7 @@
 			}else {
 				if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini_desktop") {
-					header('Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message='.lang("Message sent successfully"));
+					header('Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message='.lang("Message sent successfully").'&ignore_trace_url=true');
 				} else {
-					header('Location: index.php?menuaction=mobile.ui_home.index&success_message='.lang("Message sent successfully"));
+					header('Location: index.php?menuaction=mobile.ui_home.index&success_message='.lang("Message sent successfully").'&ignore_trace_url=true');
 				}
 			}
@@ -976,5 +976,5 @@
 				$this->imap_functions->move_messages($params_messages);
 
-				header("Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message=".lang("The messages were moved to trash"));
+				header("Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message=".lang("The messages were moved to trash").'&ignore_trace_url=true');
 				
 			}else{
Index: /branches/2.2/mobile/templates/default/new_msg.tpl
===================================================================
--- /branches/2.2/mobile/templates/default/new_msg.tpl	(revision 3935)
+++ /branches/2.2/mobile/templates/default/new_msg.tpl	(revision 4046)
@@ -14,4 +14,9 @@
 	var anexo_element = document.createElement("div");
 	anexo_box.innerHTML += "<input name=\"FILES[]\" type=\"file\">";
+}
+
+function save_msg_as_draft() {
+	document.getElementById('menuaction').value = "mobile.ui_mobilemail.save_draft";
+	document.getElementById('mail_form').submit();
 }
 
@@ -64,5 +69,5 @@
 		<div class="margin-rodape">
 			<button onclick="location.href='{href_back}'" id="cancel" class="btn-generico" >{lang_cancel}</button>
-			<button id="save_draft" class="btn-generico" onclick="document.getElementById('mail_form').action='index.php?menuaction=mobile.ui_mobilemail.save_draft';document.getElementById('mail_form').submit()" >{lang_save_draft}</button>
+			<button id="save_draft" class="btn-generico" onclick="save_msg_as_draft()" >{lang_save_draft}</button>
 			<button name="action" id="reply_send" class="btn-generico" onclick="document.getElementById('mail_form').submit()">{lang_send}</button>
 		</div>	
