Index: /trunk/expressoMail1_2/setup/setup.inc.php
===================================================================
--- /trunk/expressoMail1_2/setup/setup.inc.php	(revision 27)
+++ /trunk/expressoMail1_2/setup/setup.inc.php	(revision 51)
@@ -12,5 +12,5 @@
 	$setup_info['expressoMail1_2']['name']      	= 'expressoMail1_2';
 	$setup_info['expressoMail1_2']['title']     	= 'ExpressoMail 1.2';
-	$setup_info['expressoMail1_2']['version']   	= '1.2031';
+	$setup_info['expressoMail1_2']['version']   	= '1.210';
 	$setup_info['expressoMail1_2']['app_order'] 	= 2;
 //	$setup_info['expressoMail1_2']['tables'][]    	= 'phpgw_expressoMail1_2';
Index: /trunk/expressoMail1_2/docs/change_log.txt
===================================================================
--- /trunk/expressoMail1_2/docs/change_log.txt	(revision 41)
+++ /trunk/expressoMail1_2/docs/change_log.txt	(revision 51)
@@ -3,5 +3,11 @@
 Nilton Emilio Buhrer Neto.
 
+--------------------------- NOTA IMPORTANTE --------------------------
 
+A partir de Agosto de 2007, todos os registros de bugs aqui relatados foram
+transferidos para o site do ExpressoLivre, no Wiki-Trac do módulo.
+Vide: http://www.expressolivre.org/dev/wiki/mail/changelog
+
+----------------------------------------------------------------------
 06/02/2007 - [1.2022]
 - Fixado o layer que compreende o menu da nova mensagem (Enviar, Salvar,Pesquisar);
@@ -85,2 +91,11 @@
 - Modificado link do botão Cancelar, do template das preferências.
 - Corrigido problema na busca rápida.
+
+02/08/2007 - [1.21]
+- Feito um "refactor" da classe imap_functions, para reduzir as conexoes criadas com o IMAP.
+- Implementado filtros por flag (todas, não lidas, lidas, respondidas, importantes) na lista de mensagens.
+- O link da Ajuda do módulo foi movido para a Ajuda Geral do Expresso, ao lado de Sugestões.
+- O link Dicas e a página foram removidos.
+- Alterado alguns valores de ajuste de layout.
+- Corrigido problema dos Filtros de mensagens, quando esses possuíam caracteres especiais.
+- Implementado suporte a caracteres especiais nas Pastas.
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 46)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 51)
@@ -39,4 +39,5 @@
 	function open_mbox($folder = False)
 	{
+		$folder = mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1");
 	 	$this->mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => imap_last_error())));
 		return $this->mbox;
@@ -47,39 +48,25 @@
 		include("class.imap_attachment.inc.php");
 		$imap_attachment = new imap_attachment();
-		$folder =$params['folder'];		
+		$folder =$params['folder'];
 		$msg_range_begin = $params['msg_range_begin'];
 		$msg_range_end = $params['msg_range_end'];
 		$sort_box_type = $params['sort_box_type'];
+		$search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false;
 		$sort_box_reverse = $params['sort_box_reverse'];				
-		$mbox_stream = $this->open_mbox($folder);
+		$this->mbox = $this->open_mbox($folder);
 		
 		switch($sort_box_type){
 			case 'SORTFROM':
-				$sort_array_msg = $this->imap_sortfrom($mbox_stream, $sort_box_reverse, $folder);
+				$sort_array_msg = $this->imap_sortfrom($sort_box_reverse, $folder);
 				break;
 			case 'SORTSUBJECT':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSUBJECT, $sort_box_reverse, SE_UID);
-				break;
-			case 'SORTARRIVAL':
-				$sort_array_msg = imap_sort($mbox_stream, SORTARRIVAL, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTSUBJECT, $sort_box_reverse, SE_UID, $search_box_type);
 				break;
 			case 'SORTSIZE':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSIZE, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTSIZE, $sort_box_reverse, SE_UID, $search_box_type);
 				break;
-			case 'UNSEEN':
-			$sort_array_msg = imap_search($mbox_stream,"UNSEEN", SE_UID); // nao lidas
-			break;
-			case 'ANSWERED':
-			$sort_array_msg = imap_search($mbox_stream,"ANSWERED", SE_UID); // repondidas
-			break;
-			case 'SEEN':
-			$sort_array_msg = imap_search($mbox_stream,"SEEN", SE_UID); // lidas
-			break;
-			case 'FLAGGED':
-			$sort_array_msg = imap_search($mbox_stream,"FLAGGED", SE_UID); // importantes
-			break;
-			case 'ALL':
-			$sort_array_msg = imap_search($mbox_stream,SORTARRIVAL,$sort_box_reverse,  SE_UID); // Todas
-			break;
+			default:
+				$sort_array_msg = imap_sort($this->mbox, SORTARRIVAL, $sort_box_reverse, SE_UID, $search_box_type);
+				break;							
 		}
 		
@@ -92,5 +79,5 @@
 			$msg_number = $sort_array_msg[$msg_range_begin-1];
 
-			$header = @imap_headerinfo($mbox_stream, imap_msgno($mbox_stream, $msg_number), 80, 255);
+			$header = @imap_headerinfo($this->mbox, imap_msgno($this->mbox, $msg_number), 80, 255);
 			if (!is_object($header))
 				return false;			
@@ -136,9 +123,10 @@
 			
 			$return[$i]['attachment'] = array();
-			$return[$i]['attachment'] = $imap_attachment->get_attachment_headerinfo($mbox_stream, $msg_number);			
+			$return[$i]['attachment'] = $imap_attachment->get_attachment_headerinfo($this->mbox, $msg_number);			
 			$i++;
 		}
 		}
 		$return['num_msgs'] = $num_msgs;		
+		
 		return $return;
 	}
@@ -173,13 +161,17 @@
 	function get_info_msg($params)
 	{
-		include("class.imap_attachment.inc.php");
-		$imap_attachment = new imap_attachment();
-		
+		$return = array();
 		$msg_number = $params['msg_number'];
 		$msg_folder = $params['msg_folder'];				
-		$mbox_stream = $this->open_mbox($msg_folder);			
-		$return = array();
-		$header = imap_headerinfo($mbox_stream, imap_msgno($mbox_stream, $msg_number), 80, 255);
-		$all_header = explode("\n", imap_fetchheader($mbox_stream, $msg_number, FT_UID));
+		if(!$this->mbox)
+			$this->mbox = $this->open_mbox($msg_folder);		
+		$header = imap_headerinfo($this->mbox, imap_msgno($this->mbox, $msg_number), 80, 255);
+		$all_header = explode("\n", imap_fetchheader($this->mbox, $msg_number, FT_UID));
+		$return_get_body = $this->get_body_msg($msg_number, $msg_folder);
+		
+		$return['body'] 		= $return_get_body['body'];
+		$return['attachments'] 	= $return_get_body['attachments'];
+		$return['thumbs'] 		= $return_get_body['thumbs'];		
+		
 		foreach($all_header as $line) {
 			if (eregi("^Disposition-Notification-To", $line)) {
@@ -365,20 +357,17 @@
 		$return['Size'] = $header->Size;
 		$return['reply_toaddress'] = $header->reply_toaddress;
-		$return['body'] = $this->get_body_msg($msg_number, $msg_folder);
+		return $return;
+	}
+	
+	function get_body_msg($msg_number, $msg_folder)
+	{
+		include_once("class.message_components.inc.php");
+		$msg = &new message_components($this->mbox);
+		$msg->fetch_structure($msg_number);
+		$return = array();
+		$return['attachments'] = $this-> download_attachment($msg,$msg_number);		
 		if(!$this->has_cid)
-			$return['thumbs'] = $this->get_thumbs($msg_number, $msg_folder);
-		$return['attachments'] = $imap_attachment->download_attachment($mbox_stream, $msg_number);
-		imap_close($mbox_stream);
-		return $return;
-	}
-	
-	function get_body_msg($msg_number, $msg_folder)
-	{
-		include_once("class.message_components.inc.php");
-		$mbox_stream = $this -> open_mbox($msg_folder);
-
-		$msg =& new message_components($mbox_stream);
-		$msg->fetch_structure($msg_number);
-
+			$return['thumbs']  = $this->get_thumbs($msg,$msg_number,$msg_folder);		
+		
 		if(!$msg->structure[$msg_number]->parts) //Simple message, only 1 piece
 		{
@@ -388,9 +377,9 @@
 			if (strtolower($msg->structure[$msg_number]->subtype) == "plain")
 			{
-				$content .= nl2br($this->decodeBody((imap_body($mbox_stream, $msg_number, FT_UID)), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0]));
+				$content .= nl2br($this->decodeBody((imap_body($this->mbox, $msg_number, FT_UID)), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0]));
 			}
 			else if (strtolower($msg->structure[$msg_number]->subtype) == "html")
 			{
-				$content .= $this->decodeBody(imap_body($mbox_stream, $msg_number, FT_UID), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0]);
+				$content .= $this->decodeBody(imap_body($this->mbox, $msg_number, FT_UID), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0]);
 			}
 		}
@@ -428,5 +417,5 @@
 						// if TXT file size > 100kb, then it will not expand.
 						if(!($file_type == "text/plain" && $msg->fsize[$msg_number][$values] > 102400)) {
-							$content .= nl2br(htmlentities($this->decodeBody(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values])));							
+							$content .= nl2br(htmlentities($this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values])));							
 						}
 					}
@@ -434,5 +423,5 @@
 					else if($file_type == "text/html"  && $msg->fsize[$msg_number][$values] < 307200)
 					{
-						$content .= $this->decodeBody(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]);
+						$content .= $this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]);
 						$show_only_html = true;
 					}
@@ -440,5 +429,5 @@
 				else if($file_type == "message/delivery-status"){
 					$content .= "<hr align='left' width='95%' style='border:1px solid #DCDCDC'>";
-					$content .= nl2br($this->decodeBody(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]));						
+					$content .= nl2br($this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]));						
 
 				}
@@ -447,5 +436,5 @@
 					include_once("class.imap_attachment.inc.php");
 					$att = new imap_attachment();
-					$attachments =  $att -> get_attachment_info($mbox_stream,$msg_number);
+					$attachments =  $att -> get_attachment_info($this->mbox,$msg_number);
 					if($attachments['number_attachments'] > 0) {												
 						foreach($attachments ['attachment'] as $index => $attachment){
@@ -454,5 +443,5 @@
 								strtolower($attachment['type']) == "plain"
 							){
-								$obj = imap_rfc822_parse_headers(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values]);					
+								$obj = imap_rfc822_parse_headers(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values]);					
 								$content .= "<hr align='left' width='95%' style='border:1px solid #DCDCDC'>";					
 								$content .= "<br><table  style='margin:2px;border:1px solid black;background:#EAEAEA'>";
@@ -463,5 +452,5 @@
 								$content .= !$obj->cc ? "</table><br>" :"<tr><td><b>".$this->functions->getLang("CC").":</b></td><td>".$this->decode_string($obj->cc[0]->mailbox."@".$obj->cc[0]->host)."</td></tr></table><br>";								
 								$ix_part = 	strtolower($attachment['type']) == "delivery-status" ? 1 : 0;
-								$content .= nl2br($this->decodeBody(imap_fetchbody($mbox_stream, $msg_number, ($attachment['part_in_msg']+$ix_part).".1", FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]));								
+								$content .= nl2br($this->decodeBody(imap_fetchbody($this->mbox, $msg_number, ($attachment['part_in_msg']+$ix_part).".1", FT_UID), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]));								
 								break;			
 							}
@@ -472,7 +461,7 @@
 			if($file_type == "text/plain" && ($show_only_html &&  $msg_part == 1) ||  (!$show_only_html &&  $msg_part == 3)){
 				if(strtolower($msg->structure[$msg_number]->subtype) == "mixed" &&  $msg_part == 1)
-					$content .= nl2br(imap_base64(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID)));
+					$content .= nl2br(imap_base64(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID)));
 				else if(!strtolower($msg->structure[$msg_number]->subtype) == "mixed")
-					$content .= nl2br(imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID));				
+					$content .= nl2br(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID));				
 			}
 		} 
@@ -480,9 +469,8 @@
 		$params = array('folder' => $msg_folder, "msgs_to_set" => $msg_number, "flag" => "seen");				
 		$this->set_messages_flag($params);
-		imap_close($mbox_stream);
-		$content = $this->process_embedded_images($msg_number, $msg_folder, $content);
-		//$content = $this->htmlfilter($content);
+		$content = $this->process_embedded_images($msg,$msg_number,$content);
 		$content = $this->replace_special_characters($content);
-		return $content;
+		$return['body'] = $content;
+		return $return;
 	}
 	
@@ -645,12 +633,6 @@
 	}
 	
-	function process_embedded_images($msgno, $msg_folder, $body)
-	{
-		include_once("class.message_components.inc.php");
-
-		$mbox_stream = $this->open_mbox($msg_folder);
-
-		$msg =& new message_components($mbox_stream);
-		$msg->fetch_structure($msgno);
+	function process_embedded_images($msg, $msgno,$body)
+	{
 		
 		if (count($msg->inline_id[$msgno]) > 0)
@@ -723,12 +705,6 @@
 	}
 
-	function get_thumbs($msg_number, $msg_folder)
-	{
-	   	include_once ("class.message_components.inc.php");
-
-		$mbox_stream = $this->open_mbox($msg_folder);
-		
-    	$msg =& new message_components($mbox_stream);
-    	$msg->fetch_structure($msg_number);
+	function get_thumbs($msg, $msg_number, $msg_folder)
+	{
 		$thumbs_array = array();
 		$i = 0;
@@ -765,5 +741,7 @@
 	function delete_msgs($params)
 	{
+		
 		$folder = $params['folder'];
+		$folder =  mb_convert_encoding($folder, "UTF7-IMAP","ISO-8859-1");
 		$msgs_number = explode(",",$params['msgs_number']);
 		$border_ID = $params['border_ID'];
@@ -786,5 +764,6 @@
 		$return['border_ID'] = $border_ID;
 		
-		imap_close($mbox_stream, CL_EXPUNGE);
+		if($mbox_stream)
+			imap_close($mbox_stream, CL_EXPUNGE);
 		return $return;
 	}
@@ -801,39 +780,31 @@
 		$msgs_existent = $params['msgs_existent'];
 		$sort_box_type = $params['sort_box_type'];
+		$search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false;
 		$sort_box_reverse = $params['sort_box_reverse'];
 		$msgs_in_the_server = array();
 		$sort_array_msg = array();
-
-		$mbox_stream = $this->open_mbox($folder);
-		$num_msgs = (imap_num_msg($mbox_stream) - imap_num_recent($mbox_stream));
-		
-		$msgs_in_the_client = explode(",", $msgs_existent);
+		$this->mbox = $this->open_mbox($folder);
 		
 		switch($sort_box_type){
 			case 'SORTFROM':
-				$sort_array_msg = $this->imap_sortfrom($mbox_stream, $sort_box_reverse, $folder);
+				$sort_array_msg = $this->imap_sortfrom($sort_box_reverse, $folder);
 				break;
 			case 'SORTSUBJECT':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSUBJECT, $sort_box_reverse, SE_UID);
-				break;
-			case 'SORTARRIVAL':
-				$sort_array_msg = imap_sort($mbox_stream, SORTARRIVAL, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTSUBJECT, $sort_box_reverse, SE_UID, $search_box_type);
 				break;
 			case 'SORTSIZE':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSIZE, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTSIZE, $sort_box_reverse, SE_UID, $search_box_type);
 				break;
-			case 'ANSWERED':
-				$sort_array_msg = imap_search($mbox_stream,"ANSWERED", SE_UID); // repondidas
-				break;
-			case 'SEEN':
-				$sort_array_msg = imap_search($mbox_stream,"SEEN", SE_UID); // lidas
-				break;
-			case 'FLAGGED':
-				$sort_array_msg = imap_search($mbox_stream,"FLAGGED", SE_UID); // importantes
-				break;
-			case 'ALL':
-				$sort_array_msg = imap_search($mbox_stream,SORTARRIVAL,$sort_box_reverse,  SE_UID); // Todas
-				break;
-		}
+			default:
+				$sort_array_msg = imap_sort($this->mbox, SORTARRIVAL, $sort_box_reverse, SE_UID, $search_box_type);
+				break;							
+		}
+
+		if(!count($sort_array_msg))
+			return array();
+			
+		$num_msgs = (count($sort_array_msg) - imap_num_recent($this->mbox));
+		$msgs_in_the_client = explode(",", $msgs_existent);
+
 		
 		for ($msg_range_begin; (($msg_range_begin <= $msg_range_end) && ($msg_range_begin <= count($sort_array_msg))); $msg_range_begin++)
@@ -892,5 +863,5 @@
 		foreach($msgs_to_exec as $msg_number => $command)
 		{
-			$header = @imap_headerinfo($mbox_stream, imap_msgno($mbox_stream, $msg_number), 80, 255);
+			$header = @imap_headerinfo($this->mbox, imap_msgno($this->mbox , $msg_number), 80, 255);
 			if (!is_object($header))
 				return false;
@@ -939,9 +910,10 @@
 			
 			$return[$i]['attachment'] = array();
-			$return[$i]['attachment'] = $imap_attachment->get_attachment_headerinfo($mbox_stream, $msg_number);
+			$return[$i]['attachment'] = $imap_attachment->get_attachment_headerinfo($this->mbox, $msg_number);
 			$i++;
 		}
-		$return['new_msgs'] = imap_num_recent($mbox_stream);
-		imap_close($mbox_stream);
+		$return['new_msgs'] = imap_num_recent($this->mbox);
+		if($this->mbox)
+			imap_close($this->mbox);
 		return $return;
 	}
@@ -996,6 +968,5 @@
 		}
 		
-		imap_close($mbox_stream);
-		return $result2;
+		return array_merge($result2, $this->get_quota());
 	}
 	
@@ -1005,14 +976,15 @@
 		$mbox_stream = $this->open_mbox();
 		$imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer'];
-		//$new_folder = imap_createmailbox($mbox_stream,imap_utf7_encode("{".$imap_server."}INBOX.$namebox"));
+		$namebox =  mb_convert_encoding($namebox, "UTF7-IMAP", "UTF-8");
 		
 		$result = "Ok";
-		if(!imap_createmailbox($mbox_stream,imap_utf7_encode("{".$imap_server."}$namebox")))
+		if(!imap_createmailbox($mbox_stream,"{".$imap_server."}$namebox"))
 		{
 			$result = implode("<br />\n", imap_errors());
 		}	
-			
-		imap_close($mbox_stream);
-		
+		
+		if($mbox_stream)
+			imap_close($mbox_stream);
+					
 		return $result;
 		
@@ -1029,10 +1001,12 @@
 				if(!imap_createmailbox($mbox_stream,imap_utf7_encode("{".$imap_server."}$tmp"))){
 					$result = implode("<br />\n", imap_errors());
-					imap_close($mbox_stream);					
+					if($mbox_stream)
+						imap_close($mbox_stream);					
 					return $result;
 				}
 			}
 		}
-		imap_close($mbox_stream);
+		if($mbox_stream)
+			imap_close($mbox_stream);
 		return true;
 	}
@@ -1051,6 +1025,6 @@
 			$result = implode("<br />\n", imap_errors());
 		}
-		
-		imap_close($mbox_stream);
+		if($mbox_stream)
+			imap_close($mbox_stream);
 		return $result;
 	}
@@ -1066,10 +1040,12 @@
 		$result = "Ok";
 		$namebox = mb_convert_encoding($namebox, "UTF7-IMAP","UTF-8");
+		$new_box = mb_convert_encoding($new_box, "UTF7-IMAP","UTF-8");
+		
 		if(!imap_renamemailbox($mbox_stream,"{".$imap_server."}$namebox","{".$imap_server."}$new_box"))
 		{
-			$result = implode("<br />\n". imap_errors());
-		}
-	
-		imap_close($mbox_stream);
+			$result = imap_errors();			
+		}
+		if($mbox_stream)
+			imap_close($mbox_stream);
 		return $result;
 		
@@ -1085,5 +1061,6 @@
 		}		
 		$num_msgs = imap_num_msg($this->mbox);
-		imap_close($this->mbox);
+		if($this->mbox)
+			imap_close($this->mbox);
 		
 		return $num_msgs;
@@ -1106,5 +1083,6 @@
 		$attachments = $params['FILES'];
 		$forwarding_attachments = $params['forwarding_attachments'];
-		$folder = $params['folder'];
+		$folder =$params['folder'];
+		$folder = mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1");		
 		$folder_name = $params['folder_name'];		
 		// Fix problem with cyrus delimiter changes.
@@ -1113,5 +1091,5 @@
 		$folder = @eregi_replace("INBOX.", "INBOX".$this->imap_delimiter, $folder);
 		// End Fix.
-		if ($folder != 'null'){
+		if ($folder != 'null'){			
 			$mail->SaveMessageInFolder = $folder;
 		}
@@ -1287,19 +1265,13 @@
 	}
 	
-	function get_preferences()
-	{
-		//print_r($_SESSION['phpgw_info']['expressomail']['user']['preferences']['expressoMail']);
-		return $_SESSION['phpgw_info']['user']['preferences']['expressoMail'];
-	}
-	
-	function imap_sortfrom($mbox_stream, $sort_box_reverse, $folder)
+	function imap_sortfrom($sort_box_reverse, $folder)
 	{
 		$sortfrom = array();
 		$sortfrom_uid = array();
 		
-		$num_msgs = imap_num_msg($mbox_stream);
+		$num_msgs = imap_num_msg($this->mbox);
 		for ($i=1; $i<=$num_msgs; $i++)
 		{
-			$header = imap_headerinfo($mbox_stream, $i, 80, 255);
+			$header = imap_headerinfo($this->mbox, $i, 80, 255);
 			if (($header->from[0]->mailbox . "@" . $header->from[0]->host) == $_SESSION['phpgw_info']['expressomail']['user']['email'])				
 				$from = $header->to;
@@ -1317,5 +1289,5 @@
 		foreach($sortfrom as $index => $header_msg)
 		{
-			$sortfrom_uid[] = imap_uid($mbox_stream, $index+1);
+			$sortfrom_uid[] = imap_uid($this->mbox, $index+1);
 		}
 		
@@ -1325,10 +1297,11 @@
 		return $sortfrom_uid;
 	}
-	
+
 	function move_messages($params)
 	{
 		$folder = $params['folder'];		
 		$mbox_stream = $this->open_mbox($folder);		
-		$newmailbox = $params['new_folder'];
+		$newmailbox = ($params['new_folder']);
+		$newmailbox = mb_convert_encoding($newmailbox, "UTF7-IMAP","ISO_8859-1");
 		$new_folder_name = $params['new_folder_name'];
 		$msgs_number = $params['msgs_number'];
@@ -1338,12 +1311,13 @@
 						'border_ID' => $params['border_ID']);
 		
-		// Caso estejamos no box principal, não é necessário pegar as informação da mensagem anterior. 		
-		if (($params['get_previous_msg']) && ($params['border_ID'] != 'null'))
+		// Caso estejamos no box principal, não é necessário pegar a informação da mensagem anterior. 		
+		if (($params['get_previous_msg']) && ($params['border_ID'] != 'null') && ($params['border_ID'] != ''))
 			$return['previous_msg'] = $this->get_info_previous_msg($params);
 		
-		
+		$mbox_stream = $this->open_mbox($folder);	
 		if(imap_mail_move($mbox_stream, $msgs_number, $newmailbox, CP_UID)) {
 			imap_expunge($mbox_stream);
-			imap_close($mbox_stream);
+			if($mbox_stream)
+				imap_close($mbox_stream);
 			return $return;
 		}else {
@@ -1358,14 +1332,18 @@
 				$quota 	= imap_get_quotaroot($mbox_stream, "INBOX");				
 				if(! imap_set_quota($mbox, "user".$this->imap_delimiter.$userID, 2.1 * $quota['usage'])) {
-					imap_close($mbox_stream);									
-					imap_close($mbox);
+					if($mbox_stream)
+						imap_close($mbox_stream);
+					if($mbox)									
+						imap_close($mbox);
 					return "move_messages(): Error setting quota for MOVE or DELETE!! ". "user".$this->imap_delimiter.$userID." line ".__LINE__."\n";								
 				}
 				if(imap_mail_move($mbox_stream, $msgs_number, $newmailbox, CP_UID)) {
 					imap_expunge($mbox_stream);
-					imap_close($mbox_stream);
+					if($mbox_stream)
+						imap_close($mbox_stream);
 					// return to original quota limit.
 					if(!imap_set_quota($mbox, "user".$this->imap_delimiter.$userID, $quota['limit'])) {
-						imap_close($mbox);
+						if($mbox)
+							imap_close($mbox);
 						return "move_messages(): Error setting quota for MOVE or DELETE!! line ".__LINE__."\n";								
 					}
@@ -1373,7 +1351,9 @@
 				}
 				else {
-					imap_close($mbox_stream);
+					if($mbox_stream)
+						imap_close($mbox_stream);
 					if(!imap_set_quota($mbox, "user".$this->imap_delimiter.$userID, $quota['limit'])) {
-						imap_close($mbox);
+						if($mbox)
+							imap_close($mbox);
 						return "move_messages(): Error setting quota for MOVE or DELETE!! line ".__LINE__."\n";								
 					}
@@ -1383,6 +1363,7 @@
 			}
 			else {
-				imap_close($mbox_stream);
-				return imap_last_error();
+				if($mbox_stream)
+					imap_close($mbox_stream);
+				return "move_messages() line ".__LINE__.": ". imap_last_error()." folder:".$newmailbox;
 			}
 		}		
@@ -1392,5 +1373,7 @@
 	{
 		$folder_id = $params['folder_id'];
+		$folder_id =  mb_convert_encoding($folder_id, "UTF7-IMAP", "UTF-8");
 		$folder_name = $params['folder_name'];
+		$folder_name =  mb_convert_encoding($folder_name, "ISO-8859-1", "UTF-8");
 		$border_id = $params['border_id'];
 		$imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer'];
@@ -1404,4 +1387,5 @@
 		$body = str_replace("%nbsp;","&nbsp;",$params['body']);
 		$body = preg_replace("/\n/","",$body);
+		$body = preg_replace("/\r/","",$body);
 		
 		$header = 	"From: " . $from . "\r\n"
@@ -1420,5 +1404,6 @@
 		$return['border_id'] = $border_id;
 		
-		imap_close($mbox_stream);
+		if($mbox_stream)
+			imap_close($mbox_stream);
 		
 		if (!$return['append'])
@@ -1438,22 +1423,24 @@
 		$return["flag"] = $flag;
 		
-		$mbox_stream = $this->open_mbox($folder);
+		if(!$this->mbox)
+			$this->mbox = $this->open_mbox($folder);
 		
 		if ($flag == "unseen")
-			$return["status"] = imap_clearflag_full($mbox_stream, $msgs_to_set, "\\Seen", ST_UID);
+			$return["status"] = imap_clearflag_full($this->mbox, $msgs_to_set, "\\Seen", ST_UID);
 		elseif ($flag == "seen")
-			$return["status"] = imap_setflag_full($mbox_stream, $msgs_to_set, "\\Seen", ST_UID);
+			$return["status"] = imap_setflag_full($this->mbox, $msgs_to_set, "\\Seen", ST_UID);
 		elseif ($flag == "answered"){
-			$return["status"] = imap_setflag_full($mbox_stream, $msgs_to_set, "\\Answered", ST_UID);
-			imap_clearflag_full($mbox_stream, $msgs_to_set, "\\Draft", ST_UID);
+			$return["status"] = imap_setflag_full($this->mbox, $msgs_to_set, "\\Answered", ST_UID);
+			imap_clearflag_full($this->mbox, $msgs_to_set, "\\Draft", ST_UID);
 		}
 		elseif ($flag == "forwarded")
-			$return["status"] = imap_setflag_full($mbox_stream, $msgs_to_set, "\\Answered \\Draft", ST_UID);
+			$return["status"] = imap_setflag_full($this->mbox, $msgs_to_set, "\\Answered \\Draft", ST_UID);
 		elseif ($flag == "flagged")
-			$return["status"] = imap_setflag_full($mbox_stream, $msgs_to_set, "\\Flagged", ST_UID);
+			$return["status"] = imap_setflag_full($this->mbox, $msgs_to_set, "\\Flagged", ST_UID);
 		elseif ($flag == "unflagged")
-			$return["status"] = imap_clearflag_full($mbox_stream, $msgs_to_set, "\\Flagged", ST_UID);
-		
-		imap_close($mbox_stream);
+			$return["status"] = imap_clearflag_full($this->mbox, $msgs_to_set, "\\Flagged", ST_UID);
+		
+		if($this->mbox)
+			imap_close($this->mbox);
 		return $return;
 	}
@@ -1569,18 +1556,19 @@
 		$reuse_border = $params['reuse_border'];
 		
-		$mbox_stream = $this->open_mbox($folder);
+		if(!$this->mbox)
+			$this->mbox = $this->open_mbox($folder);
 		
 		switch($sort_box_type){
 			case 'SORTFROM':
-				$sort_array_msg = $this->imap_sortfrom($mbox_stream, $sort_box_reverse, $folder);
+				$sort_array_msg = $this->imap_sortfrom($this->mbox , $sort_box_reverse, $folder);
 				break;
 			case 'SORTSUBJECT':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSUBJECT, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox , SORTSUBJECT, $sort_box_reverse, SE_UID);
 				break;
 			case 'SORTARRIVAL':
-				$sort_array_msg = imap_sort($mbox_stream, SORTARRIVAL, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox , SORTARRIVAL, $sort_box_reverse, SE_UID);
 				break;
 			case 'SORTSIZE':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSIZE, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox , SORTSIZE, $sort_box_reverse, SE_UID);
 				break;
 		}
@@ -1603,5 +1591,5 @@
 		$params['msg_folder'] = $folder;
 		
-		$return = $this->get_info_msg($params);
+		$return = $this->get_info_msg($params);		
 		$return["reuse_border"] = $reuse_border;
 		return $return;
@@ -1610,7 +1598,5 @@
 	function get_info_previous_msg($params)
 	{
-		//$msg_number = $params['msg_number'];
 		$msg_number = $params['msgs_number'];
-		//$folder = $params['msg_folder'];
 		$folder = $params['folder'];
 		$sort_box_type = $params['sort_box_type'];
@@ -1618,18 +1604,19 @@
 		$reuse_border = $params['reuse_border'];
 		
-		$mbox_stream = $this->open_mbox($folder);
+		if(!$this->mbox)
+			$this->mbox = $this->open_mbox($folder);
 		
 		switch($sort_box_type){
 			case 'SORTFROM':
-				$sort_array_msg = $this->imap_sortfrom($mbox_stream, $sort_box_reverse, $folder);
+				$sort_array_msg = $this->imap_sortfrom($this->mbox, $sort_box_reverse, $folder);
 				break;
 			case 'SORTSUBJECT':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSUBJECT, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTSUBJECT, $sort_box_reverse, SE_UID);
 				break;
 			case 'SORTARRIVAL':
-				$sort_array_msg = imap_sort($mbox_stream, SORTARRIVAL, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTARRIVAL, $sort_box_reverse, SE_UID);
 				break;
 			case 'SORTSIZE':
-				$sort_array_msg = imap_sort($mbox_stream, SORTSIZE, $sort_box_reverse, SE_UID);
+				$sort_array_msg = imap_sort($this->mbox, SORTSIZE, $sort_box_reverse, SE_UID);
 				break;
 		}
@@ -1654,5 +1641,4 @@
 		$return = $this->get_info_msg($params);
 		$return["reuse_border"] = $reuse_border;
-		imap_close($mbox_stream);
 		return $return;
 	}
@@ -1664,7 +1650,8 @@
 		
 		$mbox_stream = $this->open_mbox($params['folder']);
-		$return_array['num_msgs'] = imap_num_msg($mbox_stream);
-		imap_close($mbox_stream);
-		//$return_array['num_msgs'] =	$this->get_num_msgs($params['folder']);		
+		$return_array['num_msgs'] = imap_num_msg($mbox_stream);		
+		if($mbox_stream)
+			imap_close($mbox_stream);
+				
 		return $return_array; 
 	}
@@ -1672,7 +1659,11 @@
 	function get_quota(){
 		
-		$mbox_stream = $this->open_mbox();
-		
-		$quota = imap_get_quotaroot($mbox_stream, "INBOX");
+		if(!$this->mbox)
+			$this->mbox = $this->open_mbox();
+		
+		$quota = imap_get_quotaroot($this->mbox, "INBOX");
+		if($this->mbox)
+			imap_close($this->mbox);
+			
 		if (!$quota){
 			return array(
@@ -1731,8 +1722,9 @@
 	function empty_trash()
 	{
-		$folder = 'INBOX' . $this->imap_delimiter . 'Trash';
+		$folder = 'INBOX' . $this->imap_delimiter . 'Lixeira';
 		$mbox_stream = $this->open_mbox($folder);
 		$return = imap_delete($mbox_stream,'1:*');
-		imap_close($mbox_stream, CL_EXPUNGE);
+		if($mbox_stream)
+			imap_close($mbox_stream, CL_EXPUNGE);
 		return $return;
 	}
@@ -1813,5 +1805,6 @@
 			}
 			$j++;
-			imap_close($mbox_stream);
+			if($mbox_stream)
+				imap_close($mbox_stream);
 		}
 	
@@ -1832,22 +1825,5 @@
 		return $return;
 	}
-	
-	/*
-	function movetotrash_and_show_previous_message($params)
-	{
-		$return = $this->get_info_previous_msg($params);
-		
-		$params_tmp1 = array();
-		$params_tmp1['msgs_number'] = $params['msg_number'];
-		$params_tmp1['folder'] = $params['msg_folder'];
-		$params_tmp1['new_folder'] = 'INBOX'.$this->imap_delimiter.'Trash';
-		
-		$return_tmp1 = $this->move_messages($params_tmp1);
-		
-		$return['msg_number_deleted'] = $return_tmp1;
-		
-		return $return;
-	}
-	*/
+		
 	
 	function automatic_trash_cleanness($params)
@@ -1855,5 +1831,5 @@
 		$before_date = date("m/d/Y", strtotime("-".$params['before_date']." day"));
 		$criteria =  'BEFORE "'.$before_date.'"';
-		$mbox_stream = $this->open_mbox('INBOX'.$this->imap_delimiter."Trash");
+		$mbox_stream = $this->open_mbox('INBOX'.$this->imap_delimiter."Lixeira");
 		$messages = imap_search($mbox_stream, $criteria, SE_UID);
 		if (is_array($messages)){
@@ -1862,6 +1838,6 @@
 			}
 		}
-		
-		imap_close($mbox_stream, CL_EXPUNGE);
+		if($mbox_stream)
+			imap_close($mbox_stream, CL_EXPUNGE);
 		return $messages;
 	}
@@ -1908,5 +1884,6 @@
 					}
 				}
-				imap_close($mbox_stream);		
+				if($mbox_stream)
+					imap_close($mbox_stream);		
 			}
 		}		
@@ -2095,4 +2072,29 @@
 		return true;
 	}
+	
+	function download_attachment($msg,$msgno)
+	{
+		$array_parts_attachments = array();		
+		$array_parts_attachments['names'] = '';
+		include("class.imap_attachment.inc.php");
+		$imap_attachment = new imap_attachment();		
+		
+		if (count($msg->fname[$msgno]) > 0)
+		{
+			$i = 0;
+			foreach ($msg->fname[$msgno] as $index=>$fname)
+			{
+				$array_parts_attachments[$i]['pid'] = $msg->pid[$msgno][$index];
+				$array_parts_attachments[$i]['name'] = $imap_attachment->flat_mime_decode($fname);
+				$array_parts_attachments[$i]['name'] = $array_parts_attachments[$i]['name'] ? $array_parts_attachments[$i]['name'] : "attachment.bin";
+				$array_parts_attachments[$i]['encoding'] = $msg->encoding[$msgno][$index];
+				$array_parts_attachments['names'] .= $array_parts_attachments[$i]['name'] . ', ';
+				$array_parts_attachments[$i]['fsize'] = $msg->fsize[$msgno][$index];
+				$i++;
+			}
+		}
+		$array_parts_attachments['names'] = substr($array_parts_attachments['names'],0,(strlen($array_parts_attachments['names']) - 2));
+		return $array_parts_attachments;
+	}	
 }
 ?>
Index: /trunk/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 2)
+++ /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 51)
@@ -75,4 +75,5 @@
 		
 		$this->folder = $params['folder'];
+		$this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8");
 		$fileNames = "";
 		$tempDir = ini_get("session.save_path");
@@ -114,4 +115,5 @@
 		
 		$this-> folder = $params['folder'];
+		$this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8");
 		$array_ids = explode(',', $params['msgs_to_export']);	
 		$error = False;		
@@ -155,4 +157,5 @@
 	function export_msg($params) {
 		$this-> folder = $params['folder'];
+		$this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8");
 		$id_number = $params['msgs_to_export'];
 		$tempDir = ini_get("session.save_path");
@@ -187,4 +190,5 @@
 		exec('mkdir ' . $tempDir . '/'.$tempSubDir.'; cd ' . $tempDir . '/'.$tempSubDir);
 		$this-> folder = $params['folder'];
+		$this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8");
 		$this->connectImap();
 		include("class.imap_attachment.inc.php");
Index: /trunk/expressoMail1_2/inc/class.ScriptS.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ScriptS.inc.php	(revision 2)
+++ /trunk/expressoMail1_2/inc/class.ScriptS.inc.php	(revision 51)
@@ -193,4 +193,24 @@
 	}
 
+        function convert_specialchar($input){
+	          $special_char = false;
+		  for ( $i = 0; $i < strlen($input); $i++ )
+		      if ( preg_match('/[áéíóúàèìòùçãõâêôç]/', $input[$i]) )
+		      {
+		          $special_char = true;
+		          $input = preg_replace('/'.$input[$i].'/', '=' . bin2hex($input[$i]), $input);
+		      }
+                   if ( $special_char )
+		   {
+		   /*  When using arrays with pattern and replacement, the keys are processed in the order they appear in the array. See preg_replace in php.net/preg_replace */
+		   $patterns[0] = '/=c3/i';
+		   $patterns[1] = '/ /';
+		   $replacements[1] = '';
+		   $replacements[0] = '_';
+		   $input = preg_replace($patterns, $replacements, $input);
+		   }
+                   return($input);
+        }
+
 	// Grava a nova regra;
 	function write_rule(){
@@ -211,9 +231,9 @@
 		  $rule['priority']      = $tmp1[1];
 		  $rule['status']        = $tmp1[2];
-          $rule['from'] 	     = $tmp1[3];
-          $rule['to']            = $tmp1[4];
-          $rule['subject']       = utf8_encode($tmp1[5]);
+          $rule['from'] 	     = $this->convert_specialchar($tmp1[3]);
+          $rule['to']            = $this->convert_specialchar($tmp1[4]);
+	  $rule['subject'] = $this->convert_specialchar($tmp1[5]);
           $rule['action'] 	     = $tmp1[6];
-		  $rule['action_arg']    = utf8_encode(preg_replace("/\\r\\n/","\r\n",$tmp1[7]));
+	  $rule['action_arg']    = utf8_encode(preg_replace("/\\r\\n/","\r\n",$tmp1[7]));
           $rule['flg'] 		     = $tmp1[8];   
           $rule['field'] 		 = $tmp1[9];
Index: /trunk/expressoMail1_2/inc/class.functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 2)
+++ /trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 51)
@@ -54,4 +54,8 @@
 			return $_SESSION['phpgw_info']['expressomail']['lang'][$key];			
 		}
+
+		function get_preferences()	{
+			return $_SESSION['phpgw_info']['user']['preferences']['expressoMail'];
+		}
 	}
 ?>
Index: /trunk/expressoMail1_2/js/common_functions.js
===================================================================
--- /trunk/expressoMail1_2/js/common_functions.js	(revision 46)
+++ /trunk/expressoMail1_2/js/common_functions.js	(revision 51)
@@ -34,7 +34,7 @@
 			div.style.height = defaultHeight - 73;
 	}
-	Element('content_folders').style.height = defaultHeight - (is_ie ? 160 : 150);
+	Element('content_folders').style.height = defaultHeight - (is_ie ? 165 : 150);
 	if(Element("divScrollMain"))
-		Element("divScrollMain").style.height 	= defaultHeight - (is_ie ? 118 : 110);	
+		Element("divScrollMain").style.height 	= defaultHeight - (is_ie ? 111 : 110);	
 }
 // END: FUNCTION RESIZE WINDOW
Index: /trunk/expressoMail1_2/js/globals.js
===================================================================
--- /trunk/expressoMail1_2/js/globals.js	(revision 13)
+++ /trunk/expressoMail1_2/js/globals.js	(revision 51)
@@ -8,4 +8,5 @@
 var preferences = '';
 var contacts = '';
+var search_box_type = 'ALL';
 var sort_box_type = 'SORTARRIVAL';
 var sort_box_reverse = 1;
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 46)
+++ /trunk/expressoMail1_2/js/main.js	(revision 51)
@@ -5,11 +5,4 @@
 		Element('tableDivAppbox').width = '100%';
 	
-	var handler_draw_paging = function(data){
-		// Load User Lang from eGroupWare.
-		Element("tot_m").innerHTML = data;
-		draw_menu();
-		//Cria Menu Ferramentas
-		ConstructMenuTools();
-	}
 	var save_contacts = function(data){
 		contacts = data;
@@ -22,5 +15,7 @@
 		if (preferences.delete_trash_messages_after_n_days != 0)
 			cExecute ("$this.imap_functions.automatic_trash_cleanness&before_date="+preferences.delete_trash_messages_after_n_days+"&cyrus_delimiter="+cyrus_delimiter, handler_automatic_trash_cleanness);
-		cExecute ("$this.imap_functions.get_num_msgs&folder=INBOX", handler_draw_paging);
+
+		ConstructMenuTools();
+		cExecute ("$this.imap_functions.get_folders_list", update_menu);
 	}
 	var handler_automatic_trash_cleanness = function(data){
@@ -38,5 +33,5 @@
 	alternate_border(0);
 	cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts);
-	cExecute ("$this.imap_functions.get_preferences", save_preferences);
+	cExecute ("$this.functions.get_preferences", save_preferences);
 	setTimeout('auto_refresh()', time_refresh);
 }
@@ -126,5 +121,5 @@
 	string_msgs_in_main = tmp.substring(0,(tmp.length-1));
 	
-	cExecute ("$this.imap_functions.refresh&folder="+current_folder+"&msgs_existent="+string_msgs_in_main+"&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse, handler_refresh);
+	cExecute ("$this.imap_functions.refresh&folder="+current_folder+"&msgs_existent="+string_msgs_in_main+"&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+"&search_box_type="+search_box_type+"&sort_box_reverse="+sort_box_reverse, handler_refresh);
 }
 
@@ -134,6 +129,6 @@
 		folder = get_current_folder();
 
-	if ((parseInt(preferences.save_deleted_msg)) && (folder!='INBOX'+cyrus_delimiter+'Trash')){
-		move_msgs(folder, msgs_number, border_ID, 'INBOX'+cyrus_delimiter+'Trash', 'Trash');
+	if ((parseInt(preferences.save_deleted_msg)) && (folder!='INBOX'+cyrus_delimiter+'Lixeira')){
+		move_msgs(folder, msgs_number, border_ID, 'INBOX'+cyrus_delimiter+'Lixeira', 'Lixeira');
 		return;
 	}
@@ -168,5 +163,5 @@
 	
 	if (msgs_number.length > 0 || parseInt(msgs_number) > 0)
-		cExecute ("$this.imap_functions.delete_msgs&folder="+folder+"&msgs_number="+msgs_number+"&border_ID="+border_ID+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"&reuse_border="+border_ID+"&get_previous_msg="+preferences.delete_and_show_previous_message, handler_delete_msgs);
+		cExecute ("$this.imap_functions.delete_msgs&folder="+folder+"&msgs_number="+msgs_number+"&border_ID="+border_ID+"&sort_box_type="+sort_box_type+"&search_box_type="+search_box_type+"&sort_box_reverse="+sort_box_reverse+"&reuse_border="+border_ID+"&get_previous_msg="+preferences.delete_and_show_previous_message, handler_delete_msgs);
 	else
 		write_msg(get_lang('No selected message.'));		
@@ -199,5 +194,5 @@
 			write_msg(get_lang("The messages were moved to %1.", data.new_folder_name));
 
-		if (data.border_ID != 'null'){
+		if (data.border_ID != '' && data.border_ID != 'null'){
 			if (parseInt(preferences.delete_and_show_previous_message))
 				show_msg(data.previous_msg);
@@ -218,5 +213,5 @@
 
 	if (parseInt(msgs_number) > 0 || msgs_number.length > 0)
-		cExecute ("$this.imap_functions.move_messages&folder="+folder+"&msgs_number="+msgs_number+"&border_ID="+border_ID+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"&reuse_border="+border_ID+"&new_folder="+new_folder+"&new_folder_name="+new_folder_name+"&get_previous_msg="+preferences.delete_and_show_previous_message, handler_move_msgs);
+		cExecute ("$this.imap_functions.move_messages&folder="+folder+"&msgs_number="+msgs_number+"&border_ID="+border_ID+"&sort_box_type="+sort_box_type+"&search_box_type="+search_box_type+"&sort_box_reverse="+sort_box_reverse+"&reuse_border="+border_ID+"&new_folder="+new_folder+"&new_folder_name="+new_folder_name+"&get_previous_msg="+preferences.delete_and_show_previous_message, handler_move_msgs);
 	else
 		write_msg(get_lang('No selected message.'));		
@@ -735,10 +730,10 @@
 		if(!verify_session(data))
 			return;
-		if (get_current_folder() == 'INBOX'+cyrus_delimiter+'Trash'){
+		if (get_current_folder() == 'INBOX'+cyrus_delimiter+'Lixeira'){
 			draw_paging(0);
 			kill_current_box();
 		}
-		tree_folders.getNodeById('INBOX'+cyrus_delimiter+'Trash').alter({caption: 'Trash'});
-		tree_folders.getNodeById('INBOX'+cyrus_delimiter+'Trash')._refresh();
+		tree_folders.getNodeById('INBOX'+cyrus_delimiter+'Lixeira').alter({caption: 'Lixeira'});
+		tree_folders.getNodeById('INBOX'+cyrus_delimiter+'Lixeira')._refresh();
 		update_quota();
 		if (data)
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 46)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 51)
@@ -1,13 +1,6 @@
-// Draw mdenu for boxes
-function draw_menu(){
-	cExecute ("$this.imap_functions.get_folders_list", update_menu);
-}
-
 function draw_tree_folders(folders){
 	// Check if the tree folders alredy exist.
-	var defaultFolders = new Array("Trash","INBOX", "Sent", "Drafts");	
-	
+
 	if (Element('dftree_tree_folders')){
-
 		var update_tree_folders = function(data){
 			for (var i=0; i<data.length; i++){
@@ -20,23 +13,19 @@
 				else if (data[i].folder_unseen > 0)
 				{
-					tree_folders.getNodeById(data[i].folder_id).alter({caption:(array_search(data[i].folder_name, defaultFolders) ? get_lang(data[i].folder_name) : data[i].folder_name) + '<font style=color:red>&nbsp(</font><span id="dftree_'+data[i].folder_id+'_unseen" style=color:red>'+data[i].folder_unseen+'</span><font style=color:red>)</font>'});
+					tree_folders.getNodeById(data[i].folder_id).alter({caption: data[i].folder_name + '<font style=color:red>&nbsp(</font><span id="dftree_'+data[i].folder_id+'_unseen" style=color:red>'+data[i].folder_unseen+'</span><font style=color:red>)</font>'});
 					tree_folders.getNodeById(data[i].folder_id)._refresh();
 				}
 				else if (data[i].folder_unseen <= 0)
 				{
-					tree_folders.getNodeById(data[i].folder_id).alter({caption:(array_search(data[i].folder_name, defaultFolders) ? get_lang(data[i].folder_name) : data[i].folder_name)});
+					tree_folders.getNodeById(data[i].folder_id).alter({caption: data[i].folder_name});
 					tree_folders.getNodeById(data[i].folder_id)._refresh();
 				}
 
-				if(data[i].folder_id == get_current_folder()){
-					var old_new_m = 0;
-					
-					if(Element('new_m')){
-						old_new_m = isNaN(parseInt(Element('new_m').innerHTML)) ? parseInt(Element('new_m').firstChild.innerHTML) : parseInt(Element('new_m').innerHTML);
-						Element('new_m').innerHTML = data[i].folder_unseen ? '<font color="RED">'+data[i].folder_unseen+'</font>' : 0;
-					}
+				if(data[i].folder_id == get_current_folder()){					
+					var old_new_m = isNaN(parseInt(Element('new_m').innerHTML)) ? parseInt(Element('new_m').firstChild.innerHTML) : parseInt(Element('new_m').innerHTML);
 					if(!isNaN(old_new_m) && old_new_m < data[i].folder_unseen){
 						Element('tot_m').innerHTML = parseInt(Element('tot_m').innerHTML) + (parseInt(data[i].folder_unseen)-old_new_m);
 					}
+					Element('new_m').innerHTML = data[i].folder_unseen ? '<font color="RED">'+data[i].folder_unseen+'</font>' : 0;
 					draw_paging(Element('tot_m').innerHTML);
 				}
@@ -51,11 +40,10 @@
 		var n_root = new dNode({id:'root', caption:'Minhas Pastas'});
 		tree_folders.add(n_root,'anything'); //Places the root; second argument can be anything.
-
+	
 		for (var i=0; i<folders.length; i++){
-						
 			if (folders[i].folder_unseen > 0)
-				var nn = new dNode({id:folders[i].folder_id, caption:(array_search(folders[i].folder_name, defaultFolders) ? get_lang(folders[i].folder_name) : folders[i].folder_name) + '<font style=color:red>&nbsp(</font><span id="dftree_'+folders[i].folder_id+'_unseen" style=color:red>'+folders[i].folder_unseen+'</span><font style=color:red>)</font>', onClick:"change_folder('"+folders[i].folder_id+"','"+folders[i].folder_name+"')", plusSign:folders[i].folder_hasChildren}); 
+				var nn = new dNode({id:folders[i].folder_id, caption:folders[i].folder_name + '<font style=color:red>&nbsp(</font><span id="dftree_'+folders[i].folder_id+'_unseen" style=color:red>'+folders[i].folder_unseen+'</span><font style=color:red>)</font>', onClick:"change_folder('"+folders[i].folder_id+"','"+folders[i].folder_name+"')", plusSign:folders[i].folder_hasChildren}); 
 			else
-				var nn = new dNode({id:folders[i].folder_id, caption:(array_search(folders[i].folder_name, defaultFolders) ? get_lang(folders[i].folder_name) : folders[i].folder_name), onClick:"change_folder('"+folders[i].folder_id+"','"+folders[i].folder_name+"')", plusSign:folders[i].folder_hasChildren}); 
+				var nn = new dNode({id:folders[i].folder_id, caption:folders[i].folder_name, onClick:"change_folder('"+folders[i].folder_id+"','"+folders[i].folder_name+"')", plusSign:folders[i].folder_hasChildren}); 
 			
 			if (folders[i].folder_parent == '')
@@ -110,6 +98,6 @@
 function update_menu(data){
 		draw_tree_folders(data);
-		update_quota();		
 		if(data) {
+			build_quota(data);
 			var f_unseen = Element('dftree_'+get_current_folder()+'_unseen');
 			if(f_unseen && f_unseen.innerHTML)
@@ -135,5 +123,5 @@
 			if(!verify_session(data))
 				return;
-			//Element("border_id_0").innerHTML = "&nbsp;" + folder_name + '&nbsp;<font face="Verdana" size="1" color="#505050">[ '+ (sort_box_type == 'SORTARRIVAL' ? '<span id="new_m">0</span> /' : '') + ' <span id="tot_m">0</span> ]</font>';
+			Element("border_id_0").innerHTML = "&nbsp;" + folder_name + '&nbsp;<font face="Verdana" size="1" color="#505050">[<span id="new_m">&nbsp;</span> / <span id="tot_m">0</span>]</font>';
 			draw_box(data, get_current_folder());
 			draw_paging(data.num_msgs);
@@ -142,5 +130,5 @@
 			alternate_border(0);
 		}
-		cExecute ("$this.imap_functions.get_range_msgs2&folder="+get_current_folder()+"&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"", handler_draw_box);
+		cExecute ("$this.imap_functions.get_range_msgs2&folder="+get_current_folder()+"&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type="+sort_box_type+ "&search_box_type="+ search_box_type +"&sort_box_reverse="+sort_box_reverse+"", handler_draw_box);
 	}
 	else
@@ -187,5 +175,5 @@
   	if(current_page != 1) {
 	  	lnk_page = document.createElement("A");
-		lnk_page.setAttribute("href", "javascript:current_page=1;kill_current_box(); draw_paging("+num_msgs+"); cExecute ('$this.imap_functions.get_range_msgs2&folder='+get_current_folder()+'&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"', function handler(data){draw_box(data, get_current_folder());})");
+		lnk_page.setAttribute("href", "javascript:current_page=1;kill_current_box(); draw_paging("+num_msgs+"); cExecute ('$this.imap_functions.get_range_msgs2&folder='+get_current_folder()+'&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+ "&search_box_type="+ search_box_type +"&sort_box_reverse="+sort_box_reverse+"', function handler(data){draw_box(data, get_current_folder());})");
   	}
   	else {
@@ -226,5 +214,5 @@
   			msg_range_begin = ((i*preferences.max_email_per_page)-(preferences.max_email_per_page-1));
 			msg_range_end = (i*preferences.max_email_per_page);
-			lnk_page.setAttribute("href", "javascript:current_page="+i+";kill_current_box(); draw_paging("+num_msgs+"); cExecute ('$this.imap_functions.get_range_msgs2&folder='+get_current_folder()+'&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"', function handler(data){draw_box(data, get_current_folder());})");
+			lnk_page.setAttribute("href", "javascript:current_page="+i+";kill_current_box(); draw_paging("+num_msgs+"); cExecute ('$this.imap_functions.get_range_msgs2&folder='+get_current_folder()+'&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+ "&search_box_type="+ search_box_type +"&sort_box_reverse="+sort_box_reverse+"', function handler(data){draw_box(data, get_current_folder());})");
   		}
   		
@@ -243,5 +231,5 @@
   		msg_range_begin = ((total_pages*preferences.max_email_per_page)-(preferences.max_email_per_page-1));
 		msg_range_end = (total_pages*preferences.max_email_per_page);  		
-		lnk_page.setAttribute("href", "javascript:current_page="+total_pages+";kill_current_box(); draw_paging("+num_msgs+"); cExecute ('$this.imap_functions.get_range_msgs2&folder='+get_current_folder()+'&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"', function handler(data){draw_box(data, get_current_folder());})");
+		lnk_page.setAttribute("href", "javascript:current_page="+total_pages+";kill_current_box(); draw_paging("+num_msgs+"); cExecute ('$this.imap_functions.get_range_msgs2&folder='+get_current_folder()+'&msg_range_begin="+msg_range_begin+"&msg_range_end="+msg_range_end+"&sort_box_type="+sort_box_type+ "&search_box_type="+ search_box_type +"&sort_box_reverse="+sort_box_reverse+"', function handler(data){draw_box(data, get_current_folder());})");
 	}
 	else {
@@ -258,5 +246,4 @@
 // Draw the inbox and another folders
 function draw_box(headers_msgs, msg_folder){
-	Element("border_id_0").innerHTML = "&nbsp;" + msg_folder + '&nbsp;<font face="Verdana" size="1" color="#505050">[ '+ (sort_box_type == 'SORTARRIVAL' ? '<span id="new_m">0</span> /' : '') + ' <span id="tot_m">0</span> ]</font>';
 	kill_current_box();
 	
@@ -304,5 +291,5 @@
 		td_element3 = document.createElement("TD");
 		td_element3.setAttribute("width", "30%");
-		td_element3.onclick = function () {sort_box('SORTFROM');};
+		td_element3.onclick = function () {sort_box(search_box_type,'SORTFROM');};
 		td_element3.id = "message_header_SORTFROM";
 		td_element3.align = "left";
@@ -311,5 +298,5 @@
 		td_element4 = document.createElement("TD");
 		td_element4.setAttribute("width", "40%");
-		td_element4.onclick = function () {sort_box('SORTSUBJECT');};
+		td_element4.onclick = function () {sort_box(search_box_type,'SORTSUBJECT');};
 		td_element4.id = "message_header_SORTSUBJECT";
 		td_element4.align = "left";
@@ -318,5 +305,5 @@
 		td_element5 = document.createElement("TD");
 		td_element5.setAttribute("width", "14%");
-		td_element5.onclick = function () {sort_box('SORTARRIVAL');};
+		td_element5.onclick = function () {sort_box(search_box_type,'SORTARRIVAL');};
 		td_element5.id = "message_header_SORTARRIVAL";
 		td_element5.align = "center";
@@ -324,5 +311,5 @@
 		td_element6 = document.createElement("TD");
 		td_element6.setAttribute("width", "14%");
-		td_element6.onclick = function () {sort_box('SORTSIZE');}
+		td_element6.onclick = function () {sort_box(search_box_type,'SORTSIZE');}
 		td_element6.id = "message_header_SORTSIZE";
 		td_element6.align = "left";
@@ -413,12 +400,9 @@
 			_dragArea.makeDragged(tr_element, headers_msgs[i].msg_number, headers_msgs[i].subject, true);
 	}
-	if(!headers_msgs.length) {
-		write_msg( get_lang("No messages found."));
-	}
 
 	var tdFolders  =  Element("folderscol");
 	tdFolders.style.display = preferences.hide_folders == '1'  ? "none" : "";
 	alternate_border(0);
-	resizeWindow();
+	resizeWindow();	
 	draw_footer_box(headers_msgs.num_msgs);	
 	Element('main_table').style.display = '';
@@ -438,5 +422,4 @@
 		Element('msg_number').value = '';
 	}
-
 
 	if(!is_ie) {
@@ -455,7 +438,6 @@
 							"TreeShow");
 							
-		connector.loadAllScripts(scripts);	
-	}
-
+		connector.loadAllScripts(scripts);
+	}
 }
 
@@ -559,5 +541,5 @@
 		}
 		else{
-			td_element3.onmouseover = function () {try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};};
+			td_element3.onmouseover = function (event) {try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};};
 			td_element3.onmouseout = function (){ try {clearTimeout(InfoContact.timeout);} catch(e){}};
 			if (headers_msgs.Draft == 'X'){
@@ -630,7 +612,6 @@
 }
 
-function sort_box(type){
-	var message_header = Element("message_header_"+type);
-	
+function sort_box(search, sort){
+	var message_header = Element("message_header_"+search);
 	var handler_draw_box = function(data){
 		draw_box(data, get_current_folder());
@@ -638,13 +619,16 @@
 	}
 
-	if(sort_box_type == type)
+	if(sort_box_type == sort && search_box_type == search){
 		sort_box_reverse = sort_box_reverse ? 0 : 1;
-	else
-		sort_box_reverse = 0;
+	}
+	else if(sort_box_type != sort){
+		sort_box_reverse = 1;
+	}
 		
 	// Global variable.
-	sort_box_type = type;
-
-	cExecute ("$this.imap_functions.get_range_msgs2&folder="+current_folder+"&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type="+type+"&sort_box_reverse="+sort_box_reverse+"", handler_draw_box);
+	sort_box_type = sort;
+	search_box_type = search;
+
+	cExecute ("$this.imap_functions.get_range_msgs2&folder="+current_folder+"&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&search_box_type="+search+"&sort_box_type="+sort+"&sort_box_reverse="+sort_box_reverse+"", handler_draw_box);
 	current_page = 1;
 	update_menu();
@@ -692,5 +676,5 @@
 	img_next_msg.title = get_lang('Next');
 	img_next_msg.style.cursor = 'pointer';
-	img_next_msg.onclick = function () {cExecute ("$this.imap_functions.get_info_next_msg&msg_number="+ info_msg.msg_number + "&msg_folder="+ info_msg.msg_folder + "&sort_box_type="+ sort_box_type + "&sort_box_reverse="+ sort_box_reverse +"&reuse_border="+ID, show_msg)};
+	img_next_msg.onclick = function () {cExecute ("$this.imap_functions.get_info_next_msg&msg_number="+ info_msg.msg_number + "&msg_folder="+ info_msg.msg_folder + "&sort_box_type="+ sort_box_type +  "&search_box_type="+ search_box_type +"&sort_box_reverse="+ sort_box_reverse +"&reuse_border="+ID, show_msg)};
 	var img_space = document.createElement("SPAN");
 	img_space.innerHTML = "&nbsp;";
@@ -699,5 +683,5 @@
 	img_previous_msg.title = get_lang('Previous');
 	img_previous_msg.style.cursor = 'pointer';
-	img_previous_msg.onclick = function () {cExecute ("$this.imap_functions.get_info_previous_msg&msgs_number="+ info_msg.msg_number + "&folder="+ info_msg.msg_folder + "&sort_box_type="+ sort_box_type + "&sort_box_reverse="+ sort_box_reverse +"&reuse_border="+ID, show_msg)}
+	img_previous_msg.onclick = function () {cExecute ("$this.imap_functions.get_info_previous_msg&msgs_number="+ info_msg.msg_number + "&folder="+ info_msg.msg_folder + "&sort_box_type="+ sort_box_type+ "&search_box_type="+ search_box_type + "&sort_box_reverse="+ sort_box_reverse +"&reuse_border="+ID, show_msg)}
 	next_previous_msg_td.appendChild(img_previous_msg);
 	next_previous_msg_td.appendChild(img_space);
@@ -2116,5 +2100,4 @@
 	div_address_full.style.display='';
 }
-
 function draw_footer_box(num_msgs){
 	var span_T = document.createElement("TABLE");
@@ -2145,9 +2128,9 @@
 	span_D.innerHTML = 
    	 get_lang("List")+': '+
-   	'<span id="span_flag_SORTARRIVAL" style="'+(sort_box_type == 'SORTARRIVAL' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("All")+'" class="message_options" onclick="sort_box(\'SORTARRIVAL\')">'+get_lang("all")+'</span>, '+
-   	'<span id="span_flag_UNSEEN" style="'+(sort_box_type == 'UNSEEN' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Unseen")+'" class="message_options" onclick="sort_box(\'UNSEEN\',this)">'+get_lang("Unseen")+'s</span>, '+
-  	'<span id="span_flag_SEEN" style="'+(sort_box_type == 'SEEN' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Seen")+'" class="message_options" onclick="sort_box(\'SEEN\',this)">'+get_lang("Seen")+'s</span>, '+
-   	'<span id="span_flag_ANSWERED" style="'+(sort_box_type == 'ANSWERED' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Answered")+'" class="message_options" onclick="sort_box(\'ANSWERED\',this)">'+get_lang("answered").toLowerCase()+'s</span>, '+
-   	'<span id="span_flag_FLAGGED" style="'+(sort_box_type == 'FLAGGED' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Flagged")+'" class="message_options" onclick="sort_box(\'FLAGGED\',this)">'+get_lang("important")+'s</span>&nbsp;&nbsp;';
+   	'<span id="span_flag_SORTARRIVAL" style="'+(search_box_type == 'ALL' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("All")+'" class="message_options" onclick="if(\'ALL\' == \''+search_box_type+'\') return false;sort_box(\'ALL\',\''+sort_box_type+'\')">'+get_lang("all")+'</span>, '+
+   	'<span id="span_flag_UNSEEN" style="'+(search_box_type == 'UNSEEN' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Unseen")+'" class="message_options" onclick="if(\'UNSEEN\' == \''+search_box_type+'\') return false;sort_box(\'UNSEEN\',\''+sort_box_type+'\')">'+get_lang("Unseen")+'s</span>, '+
+  	'<span id="span_flag_SEEN" style="'+(search_box_type == 'SEEN' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Seen")+'" class="message_options" onclick="if(\'SEEN\' == \''+search_box_type+'\') return false;sort_box(\'SEEN\',\''+sort_box_type+'\')">'+get_lang("Seen")+'s</span>, '+
+   	'<span id="span_flag_ANSWERED" style="'+(search_box_type == 'ANSWERED' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("Answered")+'" class="message_options" onclick="if(\'ANSWERED\' == \''+search_box_type+'\') return false;sort_box(\'ANSWERED\',\''+sort_box_type+'\')">'+get_lang("answered").toLowerCase()+'s</span>, '+
+   	'<span id="span_flag_FLAGGED" style="'+(search_box_type == 'FLAGGED' ? 'font-weight:bold;text-decoration:underline' : '')+'" title="'+get_lang("important")+'" class="message_options" onclick="if(\'FLAGGED\' == \''+search_box_type+'\') return false;sort_box(\'FLAGGED\',\''+sort_box_type+'\')">'+get_lang("important")+'s</span>&nbsp;&nbsp;';
 
 	span_R.appendChild(span_options);
Index: /trunk/expressoMail1_2/js/color_palette.js
===================================================================
--- /trunk/expressoMail1_2/js/color_palette.js	(revision 46)
+++ /trunk/expressoMail1_2/js/color_palette.js	(revision 51)
@@ -1,5 +1,3 @@
 // Inicializa palheta de cores;
-
-str
 function cColorPalette(){
 	this.editor;
@@ -14,5 +12,5 @@
 						new Array("#000000","#330000","#663300","#663333","#333300","#003300","#003333","#000066","#330099","#330033"));
 	this.buildPalette();
-};
+}
 
 // funçoes
Index: /trunk/expressoMail1_2/js/TreeShow.js
===================================================================
--- /trunk/expressoMail1_2/js/TreeShow.js	(revision 2)
+++ /trunk/expressoMail1_2/js/TreeShow.js	(revision 51)
@@ -58,7 +58,8 @@
 	Tree_Box.prototype.verify = function(exp)
  	{
- 		var reTipo = /^[A-Z-a-z-0-9-_]+$/;
-		if(reTipo.test(exp)){return true;}
-		else{return false;}
+ 		//var reTipo = /^[A-Z-a-z-0-9-_]+$/;
+		//if(reTipo.test(exp)){return true;}
+		//else{return false;}
+		return true;
  	}
 
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 41)
+++ /trunk/expressoMail1_2/index.php	(revision 51)
@@ -4,5 +4,5 @@
 		'nonavbar' => False,
 		'currentapp' => 'expressoMail1_2',
-		'update_version'	=> '1.2033',
+		'update_version'	=> '1.210',
 		'enable_nextmatchs_class' => True
 	);
