Index: trunk/prototype/modules/mail/js/label.js
===================================================================
--- trunk/prototype/modules/mail/js/label.js	(revision 7788)
+++ trunk/prototype/modules/mail/js/label.js	(revision 8167)
@@ -199,6 +199,6 @@
 						winElement.find('.edit').unbind("click").click(editLabel);				
 						winElement.find('.close').click(deleteLabel);
-						
-						draw_tree_labels();
+                        if( preferences['use_followupflags_and_labels'] == "1" )
+						    draw_tree_labels();
 						var msgsReference = DataLayer.get('labeled', {filter: ['=', 'labelId', ''+labelEdited.id]}, true);
 						updateMessageLabels(msgsReference);
@@ -326,6 +326,6 @@
 			.find("li:first")
 			.fadeIn("slow").click(configureLabel);
-			
-			draw_tree_labels();
+            if( preferences['use_followupflags_and_labels'] == "1" )
+			    draw_tree_labels();
 
 			$(".label-list-container .label-list li").not(".empty-item").click(function(){
Index: trunk/prototype/modules/mail/js/followupflag.js
===================================================================
--- trunk/prototype/modules/mail/js/followupflag.js	(revision 8153)
+++ trunk/prototype/modules/mail/js/followupflag.js	(revision 8167)
@@ -775,11 +775,15 @@
 
 }
-		
-$('#main_table').ready(function(){
-	handlerMessageFilter = function (data) {
-		alarmFollowupflagged(null, data);
-	}
-	/* Busca  nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */
-	cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter);
-});
-
+
+if(preferences['use_alert_filter_criteria'] == "1")
+{
+    $('#main_table').ready(function(){
+        handlerMessageFilter = function (data) {
+            alarmFollowupflagged(null, data);
+        }
+        /* Busca  nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */
+        cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter);
+    });
+}
+
+
Index: trunk/prototype/modules/mail/templates/detailedfoldertree.ejs
===================================================================
--- trunk/prototype/modules/mail/templates/detailedfoldertree.ejs	(revision 8109)
+++ trunk/prototype/modules/mail/templates/detailedfoldertree.ejs	(revision 8167)
@@ -5,5 +5,5 @@
 			Inbox: {name:'Caixa de Entrada', classe:'inbox'}, 
 		};
-    specialFolders[outboxfolder] = {name: 'Caixa de Saída', classe:'outbox'};
+    specialFolders[outboxfolder] = {name: 'Caixa de Saï¿œda', classe:'outbox'};
 	specialFolders[trashfolder] = {name:'Lixeira', classe:'trash'};
 	specialFolders[draftsfolder] = {name:'Rascunhos', classe:'drafts'};
@@ -67,5 +67,7 @@
 
 	  <%}%>
+        <% if(preferences['use_followupflags_and_labels'] == "1"){%>
 	  <li><span class="folder head_folder all_accomp followup-messages">Para acompanhamento</span>
+          <%}%>
 	  </li>
 	</ul>
Index: trunk/prototype/modules/filters/filters.js
===================================================================
--- trunk/prototype/modules/filters/filters.js	(revision 8100)
+++ trunk/prototype/modules/filters/filters.js	(revision 8167)
@@ -2,18 +2,22 @@
  * Retorna as regras por remetente e que o usuário deseja ser avisado 
  */
-function getFromAlertRules() { 
-	var filters = DataLayer.get("filter");
-	fromRules = [];
-	var alertMessage;
-	var active;
-	for (var index in filters) {
-		alertMessage = filters[index]['alertMessage'];		
-		active = filters[index]['enabled'];
-		for(var criterias in filters[index]['actions']) {
-			if (filters[index]['actions'][criterias]['type'] == 'fileinto' && alertMessage == 'true' && active == 'true')
-				fromRules[fromRules.length] = filters[index]['actions'][criterias]['parameter'];
-		}
-	}
-	return fromRules;
+function getFromAlertRules() {
+    fromRules = [];
+    if(preferences['use_alert_filter_criteria'] == "1")
+    {
+        var filters = DataLayer.get("filter");
+        var alertMessage;
+        var active;
+        for (var index in filters) {
+            alertMessage = filters[index]['alertMessage'];
+            active = filters[index]['enabled'];
+            for(var criterias in filters[index]['actions']) {
+                if (filters[index]['actions'][criterias]['type'] == 'fileinto' && alertMessage == 'true' && active == 'true')
+                    fromRules[fromRules.length] = filters[index]['actions'][criterias]['parameter'];
+            }
+        }
+
+    }
+    return fromRules;
 }
 
@@ -401,6 +405,8 @@
 });
 
-
-fromRules = getFromAlertRules();
+if(preferences['use_alert_filter_criteria'] == "1")
+{
+    fromRules = getFromAlertRules();
+}
 
 var BASE_PATH = '../prototype/';
@@ -1042,14 +1048,18 @@
 		}
 	}
-	$.each(fromRules, function(index, value) {
-		if(value == folder){
-			for(var i=0; i < filters_c['criteria'].length; i++){
-				if(filters_c['criteria'][i].field == 'from'){
-					from = filters_c['criteria'][i].value;
-				}
-			}
-			cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&from="+from, function(){}); 
-			return false;
-		}
-	});
-}
+
+    if(preferences['use_alert_filter_criteria'] == "1")
+    {
+        $.each(fromRules, function(index, value) {
+            if(value == folder){
+                for(var i=0; i < filters_c['criteria'].length; i++){
+                    if(filters_c['criteria'][i].field == 'from'){
+                        from = filters_c['criteria'][i].value;
+                    }
+                }
+                cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&from="+from, function(){});
+                return false;
+            }
+        });
+    }
+}
Index: trunk/prototype/modules/filters/edit-filter.ejs
===================================================================
--- trunk/prototype/modules/filters/edit-filter.ejs	(revision 7892)
+++ trunk/prototype/modules/filters/edit-filter.ejs	(revision 8167)
@@ -128,6 +128,10 @@
 					%>
 				</select>
-				<input type="checkbox" name="actionType[]" value="alertMessage" class="alertMessage"/>
-				<label><%= get_lang("Alert message filter by sender")%></label>
+                <%
+                if(preferences['use_alert_filter_criteria'] == "1")
+                {%>
+                    <input type="checkbox" name="actionType[]" value="alertMessage" class="alertMessage"/>
+                    <label><%= get_lang("Alert message filter by sender")%></label>
+                <%}%>
 			</fieldset>
 			<fieldset>
Index: trunk/expressoMail1_2/index.php
===================================================================
--- trunk/expressoMail1_2/index.php	(revision 7915)
+++ trunk/expressoMail1_2/index.php	(revision 8167)
@@ -16,5 +16,5 @@
 		'enable_nextmatchs_class' => True
 	);
-	
+
 	require_once('../header.inc.php');
 	include_once dirname(__FILE__) . '/../header.inc.php';
@@ -33,4 +33,5 @@
 	$_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
 	echo "<script type='text/javascript'>var template = '".$_SESSION['phpgw_info']['expressoMail1_2']['user']['preferences']['common']['template_set']."';</script>";
+
 
 	//jquery and Editor 
@@ -78,5 +79,21 @@
 		  <script type="text/javascript" src="js/DropDownContacts.js"></script>
 		  ';
-	
+
+//
+//    include_once(__DIR__.'/inc/class.imap_functions.inc.php');
+//
+//    $param = array();
+//    $param['folder'] = 'INBOX';
+//    $param['msg_range_begin'] = '1';
+//    $param['msg_range_end'] = '50';
+//    $param['sort_box_type'] = 'SORTARRIVAL';
+//    $param['search_box_type'] = 'ALL';
+//    $param['sort_box_reverse'] = '1';
+//
+//    $imapf = new imap_functions();
+//    $initialMessages = $imapf->get_range_msgs2($param);
+//
+//    echo '<script type="text/javascript"> var initialMessages  = '.json_encode($initialMessages).'</script>';
+
 	/*
 	 * TODO: implementar o controle como preferência do usuário 
@@ -338,5 +355,5 @@
 	//echo $obj -> getFilesJs("js/common_functions.js",$update_version);
 	include("inc/load_lang.php");
-    
+
     // INCLUDE these JS Files:
 	if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']) 
@@ -353,6 +370,6 @@
 	echo "<script> use_local_messages = ".$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']."</script>";		
 	if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])
-		$scripts .= "js/local_messages.js";	
-		
+		$scripts .= "js/local_messages.js";
+
 	echo '
 		<!--<script type="text/javascript" src="../prototype/modules/mail/js/followupflag.js"></script>-->
@@ -364,7 +381,24 @@
 	';
 
-	echo 
+//////////////////////////////////////////// Carregar Timezones para o javascript /////////////////////////////////////////
+
+    $zones = timezone_identifiers_list();
+    $Time = new DateTime('now', new DateTimeZone('UTC'));
+    $timezone = array();
+
+    foreach ($zones as $zone)
+    {
+        $timezone['timezones'][$zone] = $Time->setTimezone(new DateTimeZone($zone))->format('O');
+    }
+
+    $localtime = localtime(time(), true);
+    $timezone['isDaylightSaving'] =  !!$localtime['tm_isdst'] ? 1 : 0;
+
+    echo '<script type="text/javascript"> var Timezone  = '.json_encode($timezone).'</script>';
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	echo
 	    '<script src="../prototype/plugins/datejs/date-pt-BR.js" language="javascript" ></script>
-		<script src="../prototype/modules/calendar/js/timezone.js" language="javascript" ></script>
 		<script src="../prototype/plugins/dateFormat/dateFormat.js" language="javascript" ></script>
 		<script src="../prototype/modules/calendar/js/calendar.date.js" language="javascript" ></script>
@@ -375,7 +409,31 @@
 	echo $obj -> getFilesJs($scripts, $update_version);
 	echo '<script type="text/javascript">connector.updateVersion = "'.$update_version.'";</script>';
-		
 	echo '<script type="text/javascript" src="assetic.php"></script>';
-	
+
+/////////   Verifica se o usuario esta fora do escritorio imprime a variavel javascript "outOfficeFlag" /////////////////////////////
+
+    include_once(__DIR__ .'/../library/Net/Sieve.php');
+    $sieveConf  =  parse_ini_file( __DIR__."/../prototype/config/Sieve.srv", true );
+    $sieveConf = $sieveConf['config'];
+    $sieve = new Net_Sieve();
+    $inVacation = false;
+    @$sieve->connect( $sieveConf['host'] , $sieveConf['port'] , $sieveConf['options'] , $sieveConf['useTLS'] );
+    @$sieve->login( $_SESSION['wallet']['Sieve']['user'], $_SESSION['wallet']['Sieve']['password'] , $sieveConf['loginType']);
+    $script = $sieve->getScript($sieve->getActive());
+    $pos = strripos($script, "#PseudoScript#");
+    $pseudo_script = substr( $script, $pos+17 );
+    $sieveRules = json_decode( $pseudo_script, true );
+    foreach( $sieveRules as $i => $v)
+        if($v['id'] == 'vacation' && $v['enabled'] == 'true')
+            $inVacation = true;
+
+    if($inVacation)
+        echo '<script language="javascript"> write_msg(get_lang("Attention, you are in out of office mode."), true);   </script>';
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+
 
 	// Get Preferences or redirect to preferences page.
Index: trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 8145)
+++ trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 8167)
@@ -233,38 +233,40 @@
                                     ++$i;
                             }
-							
-							$filter = array('AND', array('=', 'folderName', $folder), array('IN','messageNumber', $sort_array_msg));
-							$followupflagged = Controller::find(
-								array('concept' => 'followupflagged'),
-								false, 
-								array('filter' => $filter, 'criteria' => array('deepness' => '2'))
-							);
-							$labeleds = Controller::find(
-								array('concept' => 'labeled'),
-								false, 
-								array('filter' => $filter, 'criteria' => array('deepness' => '2'))
-							);
-                            $sort_array_msg_count = count($sort_array_msg);
-							for($i=0; $i<$sort_array_msg_count; ++$i){
-								if(!isset($return[$i]['msg_number']))
-									continue;
-									
-								$numFlags = count($followupflagged);
-								for($ii=0; $ii<$numFlags; ++$ii){
-									if($return[$i]['msg_number'] == $followupflagged[$ii]['messageNumber']){
-										$followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[$ii]['followupflagId'] ));
-										$return[$i]['followupflagged'] = $followupflagged[$ii];
-										$return[$i]['followupflagged']['followupflag'] = $followupflag;
-										break;
-									}
-								}
-								$numLabels = count($labeleds);
-								for($ii=0; $ii<$numLabels; ++$ii){
-									if($return[$i]['msg_number'] == $labeleds[$ii]['messageNumber']){
-										$labels = Controller::read( array( 'concept' => 'label', 'id' =>  $labeleds[$ii]['labelId'])); 
-										$return[$i]['labels'][$labeleds[$ii]['labelId']] = $labels;
-									}
-								}
-							}
+                            if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_followupflags_and_labels'] == "1")
+                            {
+                                $filter = array('AND', array('=', 'folderName', $folder), array('IN','messageNumber', $sort_array_msg));
+                                $followupflagged = Controller::find(
+                                    array('concept' => 'followupflagged'),
+                                    false,
+                                    array('filter' => $filter, 'criteria' => array('deepness' => '2'))
+                                );
+                                $labeleds = Controller::find(
+                                    array('concept' => 'labeled'),
+                                    false,
+                                    array('filter' => $filter, 'criteria' => array('deepness' => '2'))
+                                );
+                                $sort_array_msg_count = count($sort_array_msg);
+                                for($i=0; $i<$sort_array_msg_count; ++$i){
+                                    if(!isset($return[$i]['msg_number']))
+                                        continue;
+
+                                    $numFlags = count($followupflagged);
+                                    for($ii=0; $ii<$numFlags; ++$ii){
+                                        if($return[$i]['msg_number'] == $followupflagged[$ii]['messageNumber']){
+                                            $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[$ii]['followupflagId'] ));
+                                            $return[$i]['followupflagged'] = $followupflagged[$ii];
+                                            $return[$i]['followupflagged']['followupflag'] = $followupflag;
+                                            break;
+                                        }
+                                    }
+                                    $numLabels = count($labeleds);
+                                    for($ii=0; $ii<$numLabels; ++$ii){
+                                        if($return[$i]['msg_number'] == $labeleds[$ii]['messageNumber']){
+                                            $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $labeleds[$ii]['labelId']));
+                                            $return[$i]['labels'][$labeleds[$ii]['labelId']] = $labels;
+                                        }
+                                    }
+                                }
+                            }
                     }
                     $return['num_msgs'] =  $num_msgs;   
@@ -4446,28 +4448,30 @@
                                             $elem['uid'] = $new_search;
                                             /* compare dates in ordering */
-                                            $elem['udatecomp'] = substr ($elem['udate'], -4) ."-". substr ($elem['udate'], 3, 2) ."-". substr ($elem['udate'], 0, 2);  
-
-											$filter = array('AND', array('=', 'folderName', $name_box), array('=','messageNumber', $new_search));
-											$followupflagged = Controller::find(
-												array('concept' => 'followupflagged'),
-												false, 
-												array('filter' => $filter, 'criteria' => array('deepness' => '2'))
-											);
-
-											if(isset($followupflagged[0]['followupflagId']))
-											{
-												$followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));     
-												$followupflagged[0]['followupflag'] = $followupflag;
-												$elem['followupflagged'] = $followupflagged[0];
-
-											}	
-											$labeleds = Controller::find(
-												array('concept' => 'labeled'),
-												false, 
-												array('filter' => $filter, 'criteria' => array('deepness' => '2'))
-											);
-											foreach ($labeleds as $e){
-												$labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));     
-												$elem['labels'][$e['labelId']] = $labels;
+                                            $elem['udatecomp'] = substr ($elem['udate'], -4) ."-". substr ($elem['udate'], 3, 2) ."-". substr ($elem['udate'], 0, 2);
+                                            if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_followupflags_and_labels'] == "1")
+                                            {
+                                                $filter = array('AND', array('=', 'folderName', $name_box), array('=','messageNumber', $new_search));
+                                                $followupflagged = Controller::find(
+                                                    array('concept' => 'followupflagged'),
+                                                    false,
+                                                    array('filter' => $filter, 'criteria' => array('deepness' => '2'))
+                                                );
+
+                                                if(isset($followupflagged[0]['followupflagId']))
+                                                {
+                                                    $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));
+                                                    $followupflagged[0]['followupflag'] = $followupflag;
+                                                    $elem['followupflagged'] = $followupflagged[0];
+
+                                                }
+                                                $labeleds = Controller::find(
+                                                    array('concept' => 'labeled'),
+                                                    false,
+                                                    array('filter' => $filter, 'criteria' => array('deepness' => '2'))
+                                                );
+                                                foreach ($labeleds as $e){
+                                                    $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));
+                                                    $elem['labels'][$e['labelId']] = $labels;
+                                                }
                                             }
                                             $retorno[] = $elem;
@@ -5113,29 +5117,35 @@
 				foreach ($subject as $tmp)
 					$return['msgs'][$i]['subject'] .= mb_convert_encoding($tmp->text, 'UTF-8', 'UTF-8 , ISO-8859-1');
-				
-				$filter = array('AND', array('=', 'folderName', $folder), array('=','messageNumber', $v));
-				$followupflagged = Controller::find(
-					array('concept' => 'followupflagged' , 'folder' => $folder ),
-					false, 
-					array('filter' => $filter, 'criteria' => array('deepness' => '2'))
-				);
-
-				if(isset($followupflagged[0]['followupflagId']))
-				{
-					$followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));     
-					$followupflagged[0]['followupflag'] = $followupflag;
-					$return['msgs'][$i]['followupflagged'] = $followupflagged[0];
-
-				}	
-				$labeleds = Controller::find(
-					array('concept' => 'labeled'),
-					false, 
-					array('filter' => $filter, 'criteria' => array('deepness' => '2'))
-				);
-				if(is_array($labeleds))
-				foreach ($labeleds as $e){
-					$labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));     
-					$return['msgs'][$i]['labels'][$e['labelId']] = $labels;
-				}	
+
+
+                if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_followupflags_and_labels'] == "1")
+                {
+
+                    $filter = array('AND', array('=', 'folderName', $folder), array('=','messageNumber', $v));
+                    $followupflagged = Controller::find(
+                        array('concept' => 'followupflagged' , 'folder' => $folder ),
+                        false,
+                        array('filter' => $filter, 'criteria' => array('deepness' => '2'))
+                    );
+
+                    if(isset($followupflagged[0]['followupflagId']))
+                    {
+                        $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));
+                        $followupflagged[0]['followupflag'] = $followupflag;
+                        $return['msgs'][$i]['followupflagged'] = $followupflagged[0];
+
+                    }
+                    $labeleds = Controller::find(
+                        array('concept' => 'labeled'),
+                        false,
+                        array('filter' => $filter, 'criteria' => array('deepness' => '2'))
+                    );
+                    if(is_array($labeleds))
+                    foreach ($labeleds as $e){
+                        $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));
+                        $return['msgs'][$i]['labels'][$e['labelId']] = $labels;
+                    }
+                }
+
 				$mimeBody = imap_body( $this->mbox, $v  , FT_UID|FT_PEEK  );
 				$return['msgs'][$i]['flag'] = ' ';
Index: trunk/expressoMail1_2/inc/hook_settings.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/hook_settings.inc.php	(revision 8165)
+++ trunk/expressoMail1_2/inc/hook_settings.inc.php	(revision 8167)
@@ -369,4 +369,7 @@
 
 create_check_box('View the user name in the header of the messages printed?', 'show_name_print_messages', 'Displays the user name in the header print email');
+
+create_check_box('Habilitar funcionalidade de notificar ao receber mensagens filtradas por remetente ?', 'use_alert_filter_criteria', '');
+create_check_box('Habilitar sinalizadores e marcadores em mensagens', 'use_followupflags_and_labels', '');
 
 //$default = 0;
Index: trunk/expressoMail1_2/js/main.js
===================================================================
--- trunk/expressoMail1_2/js/main.js	(revision 8154)
+++ trunk/expressoMail1_2/js/main.js	(revision 8167)
@@ -226,4 +226,5 @@
     // Fim da inserção da applet
     cExecute("$this.imap_functions.get_folders_list&onload=true", update_menu);
+    //update_menu(Folder.getList(false));
 
     if($.cookie('collapse_folders') == "true"){
@@ -295,8 +296,4 @@
 	// Get cyrus delimiter
 	cyrus_delimiter = Element('cyrus_delimiter').value;
-
-    cExecute ("phpgwapi.browser.isMobile", function( data ){
-		mobile_device = ( ( data.constructor == Boolean ) ? data : ( data === 'true' ) );
-	});
 
 	cExecute("$this.imap_functions.get_folders_list&onload=true", update_menu);	
@@ -719,11 +716,15 @@
 	getFromAlertRules();
 	var handler_refresh = function(data){
-		handlerMessageFilter = function (data) {			
-			notificationFilter(data, notifyPermission);
-			alarmFollowupflagged('filtersAlarms', data);
-			
-		}
-		/* Busca  nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */
-		cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter);
+
+        if(preferences['use_alert_filter_criteria'] == "1")
+        {
+            var handlerMessageFilter = function (data) {
+                notificationFilter(data, notifyPermission);
+                alarmFollowupflagged('filtersAlarms', data);
+
+            }
+            /* Busca  nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */
+            cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter);
+        }
 
 		if(data['msg_range_end'])
@@ -1695,11 +1696,14 @@
 				}
 				var hasFolder = false;
-				$.each(fromRules, function(index, value) {
-					if(value == folder){
-						hasFolder = true;
-						cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&msg_number="+msgs_number, handler_removeFlag); 
-						return false;
-					}
-				});
+                if(preferences['use_alert_filter_criteria'] == "1")
+                {
+                    $.each(fromRules, function(index, value) {
+                        if(value == folder){
+                            hasFolder = true;
+                            cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&msg_number="+msgs_number, handler_removeFlag);
+                            return false;
+                        }
+                    });
+                }
 				if(!hasFolder){
 					handler_removeFlag();
@@ -3886,12 +3890,14 @@
 						Element("check_box_message_" + msgs_to_set[i]).checked = false;
 
-						// remove a flag $FilteredMessage da mensagem ao ser marcada como lida	
-						$.each(fromRules, function(index, value) {
-							if(value == folder){
-								cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&msg_number="+msgs_to_set, function(){}); 
-								return false;
-							}
-						});	
-						
+                        if(preferences['use_alert_filter_criteria'] == "1")
+                        {
+                            // remove a flag $FilteredMessage da mensagem ao ser marcada como lida
+                            $.each(fromRules, function(index, value) {
+                                if(value == folder){
+                                    cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&msg_number="+msgs_to_set, function(){});
+                                    return false;
+                                }
+                            });
+                        }
 						break;
 					case "flagged":
@@ -4463,5 +4469,6 @@
 		update_quota(get_current_folder());
 		draw_new_tree_folder();
-		draw_tree_labels();
+        if( preferences['use_followupflags_and_labels'] == "1" )
+		    draw_tree_labels();
 		if (data){
 			if(typeof(data) == "object"){
@@ -4522,5 +4529,6 @@
 		//tree_folders.getNodeById(mount_url_folder(["INBOX",special_folders["Spam"]]))._refresh();
 		draw_new_tree_folder();
-		draw_tree_labels();
+        if( preferences['use_followupflags_and_labels'] == "1" )
+		    draw_tree_labels();
 		update_quota(get_current_folder());
 		if (data){
Index: trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- trunk/expressoMail1_2/js/draw_api.js	(revision 8163)
+++ trunk/expressoMail1_2/js/draw_api.js	(revision 8167)
@@ -106,4 +106,5 @@
 			}
 			cExecute ("$this.imap_functions.get_folders_list&folder="+current_folder, update_tree_folders);
+            
 		}
 
@@ -472,6 +473,4 @@
 		}
 	}
-	
-	outOfficeVerify();
 }
 
@@ -647,5 +646,8 @@
 		}
 		draw_new_tree_folder(false, forceLoadFolders);
-		draw_tree_labels();
+
+        if( preferences['use_followupflags_and_labels'] == "1" )
+            draw_tree_labels();
+
 		if(Element("table_quota"))
 			connector.loadScript("InfoQuota");
@@ -1751,8 +1753,5 @@
 	draw_footer_box(headers_msgs.num_msgs);
 	Element('main_table').style.display = '';
-	if(is_ie6)	  // Stupid Fixing on IE6.
-		setTimeout("resizeWindow()",1);
-	else
-		resizeWindow();
+	resizeWindow();
 	if(debug) {
 		var _eTime = new Date();
@@ -2468,5 +2467,5 @@
 function draw_message(info_msg, ID){
 	// remove a flag $FilteredMessage da mensagem ao ser lida
-	if(info_msg.Unseen == "U"){
+	if(info_msg.Unseen == "U" && preferences['use_alert_filter_criteria'] == "1"){
 		$.each(fromRules, function(index, value) {
 			if(value == info_msg.msg_folder){
Index: trunk/expressoMail1_2/js/doiMenuData.js
===================================================================
--- trunk/expressoMail1_2/js/doiMenuData.js	(revision 8130)
+++ trunk/expressoMail1_2/js/doiMenuData.js	(revision 8167)
@@ -142,8 +142,12 @@
     function loadMenu(){
         var archive = "";
-    	var labelItems = getLabels();
+
+        if( preferences['use_followupflags_and_labels'] == "1" )
+            var labelItems = getLabels();
+
         var revertSortBox = function(){
             if (search_box_type == "UNSEEN") sort_box_reverse = sort_box_reverse ? 0 : 1; 
         }
+
     	$.contextMenu({
     		selector: ".table_box tbody tr",
@@ -161,9 +165,10 @@
                 }
 
-                var itensNotLocal = {
-                    "label": { "name": get_lang("Labels"), "items": labelItems},
-                    "follouwpflag":{"name": get_lang("Follow up"), callback: function(key, opt){ configureFollowupflag(); } },
-                    "sep2": "---------"
-                }
+                if( preferences['use_followupflags_and_labels'] == "1" )
+                    var itensNotLocal = {
+                        "label": { "name": get_lang("Labels"), "items": labelItems},
+                        "follouwpflag":{"name": get_lang("Follow up"), callback: function(key, opt){ configureFollowupflag(); } },
+                        "sep2": "---------"
+                    }
 
                 var items= {
@@ -370,4 +375,6 @@
     		menuItensLabel[index] = {type: "label", customName: menuItems[index].name, id: msg_folder+"/"+msg_number+"#"+index};		
     	}
+
+
     	$.contextMenu.types.label = function(item, opt, root) {
             $('<span>'+item.customName+'</span><span class="removeLabeled" title="'+get_lang("Remove Label")+'">x</span>')
