Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 197)
+++ /trunk/expressoMail1_2/js/main.js	(revision 206)
@@ -16,4 +16,6 @@
 			cExecute ("$this.imap_functions.automatic_trash_cleanness&before_date="+preferences.delete_trash_messages_after_n_days+"&cyrus_delimiter="+cyrus_delimiter, handler_automatic_trash_cleanness);
 
+		if(preferences.outoffice)
+			write_msg(get_lang("Attention, you are in out of office mode."), true);
 		ConstructMenuTools();
 		cExecute ("$this.imap_functions.get_folders_list", update_menu);
@@ -35,14 +37,4 @@
 	cExecute ("$this.functions.get_preferences", save_preferences);
 	setTimeout('auto_refresh()', time_refresh);
-	
-	var handler_sieve = function(data){
-		if(data.vacation && data.vacation[0]) {
-			var vacation =  data.vacation[0].split("&&");
-			if(vacation[4].replace("\n","") == "on"){
-				write_msg(get_lang("Attention, you are in out of office mode."), true);
-			}
-		}
-	}
-	cExecute("$this.ScriptS.init_a",handler_sieve);
 }
 
@@ -50,4 +42,11 @@
 	if(!verify_session(msg_info))
 		return;
+	
+	if (msg_info.status_get_msg_info == 'false')
+	{
+		write_msg(get_lang("Problems reading your message")+ ".");
+		return;
+	}
+	
 	var handler_sendNotification = function(data){
 		if (data)
Index: /trunk/expressoMail1_2/js/filter.js
===================================================================
--- /trunk/expressoMail1_2/js/filter.js	(revision 197)
+++ /trunk/expressoMail1_2/js/filter.js	(revision 206)
@@ -359,5 +359,12 @@
 		// out office
 		if(Element("out_0") != null){
-			if(Element("out_0").checked){_this.out_officeR =''; _this.out_officeF = false;}
+			if(Element("out_0").checked){
+				_this.out_officeR ='';
+				_this.out_officeF = false;
+				//Save outoffice in prefs:
+				if(!prefe)
+					connector.loadScript("preferences");
+				prefe.save("outoffice", _this.out_officeF);
+			}
 		}
 		_this.reload_rules();
@@ -515,4 +522,8 @@
 				aux_rul += "_end_\n";
 				_this.out_officeF = (aux[4].replace("\n","") == "off") ? false : true;
+				//Save outoffice in prefs:
+				if(!prefe)
+					connector.loadScript("preferences");
+				prefe.save("outoffice", _this.out_officeF);
 		}
 		var h_filter = function(data){
Index: /trunk/expressoMail1_2/js/preferences.js
===================================================================
--- /trunk/expressoMail1_2/js/preferences.js	(revision 197)
+++ /trunk/expressoMail1_2/js/preferences.js	(revision 206)
@@ -138,5 +138,5 @@
 	Preferences.prototype.save_form = function(){
 	
-	   	var prefe_string;			
+	   //var prefe_string;			
 		var reload_page = false;
 
@@ -155,32 +155,19 @@
 				
 		preferences.max_email_per_page = Element("sel_num_max").value; 
-		prefe_string = Element("sel_num_max").value + "##";
 	 	preferences.save_deleted_msg = Element("check_save_men").checked ? 1 : 0;
-	 	prefe_string += (Element("check_save_men").checked ? "1": "0") + "##";	   	
 		preferences.delete_trash_messages_after_n_days = Element("sel_del_men").value;
-		prefe_string += Element("sel_del_men").value + "##";
 		preferences.delete_and_show_previous_message = Element("check_show_previous").checked ? 1 : 0;
-		prefe_string +=( Element("check_show_previous").checked ? "1" :"0") + "##";
 		preferences.alert_new_msg = Element("check_alert").checked ? 1 : 0;
-		prefe_string += (Element("check_alert").checked ? "1" : "0") + "##";
 		preferences.mainscreen_showmail = Element("check_view").checked ? 1 : 0;
-		prefe_string += (Element("check_view").checked ? "1" : "0") + "##";
 	   	preferences.save_in_folder = Element("sel_name_box").value;
-		prefe_string += Element("sel_name_box").value + "##";
 		preferences.hide_folders = Element("check_menu").checked ? 1 : 0;
-		prefe_string += (Element("check_menu").checked ? "1": "0" ) + "##";
 	    preferences.line_height = Element("sel_height_line").value;
-	    prefe_string += Element("sel_height_line").value + "##";
 		preferences.font_size = Element("sel_size_font").value;
-		prefe_string += Element("sel_size_font").value + "##";
 		preferences.signature = Element("txt_signature").value;
-		prefe_string += url_encode(Element("txt_signature").value) + "##";
-		preferences.check_use_shortcuts = Element("check_use_shortcuts").checked ? 1 : 0;
-		prefe_string += Element("check_use_shortcuts").checked ? "1":"0";
-		
+		preferences.check_use_shortcuts = Element("check_use_shortcuts").checked ? 1 : 0;		
 		var _this = this;
 		
 	   	var handler_preferences = function(data){
-	   		if( data == "OK!"){
+	   		if(data && data.success){
 	   			if(reload_page)
 			   		window.location.reload(true);
@@ -192,5 +179,5 @@
 	   	}
 	   	var args   = "$this.db_functions.update_preferences";
-	   	var params = "prefe_string="+prefe_string;
+		var params = "prefe_string="+url_encode(connector.serialize(preferences));
 	   	cExecute(args,handler_preferences,params);
 	}	
@@ -200,4 +187,19 @@
 	}
 	
+	// Salva uma unica preferencia
+	Preferences.prototype.save = function(key, value){
+		var _this = this;		
+	   	var handler_preferences = function(data){
+	   		if(data && data.success)
+	   			return;	   		
+	   		else
+	   			alert(data);
+	   	}
+	   	preferences[key] = value;
+	   	var args   = "$this.db_functions.update_preferences";
+		var params = "prefe_string="+url_encode(connector.serialize(preferences));
+	   	cExecute(args,handler_preferences,params);
+	}	
+
 	//Limpa os campos
 	Preferences.prototype.clean_all = function(){
