diff -r -u original/hildon2/modest-default-account-settings-dialog.c changed/hildon2/modest-default-account-settings-dialog.c
--- original/hildon2/modest-default-account-settings-dialog.c	2010-03-06 16:07:41.885431120 +0000
+++ changed/hildon2/modest-default-account-settings-dialog.c	2010-03-06 16:07:59.200449477 +0000
@@ -125,6 +125,7 @@
 	GtkWidget *entry_outgoingserver;
 	GtkWidget *checkbox_outgoing_smtp_specific;
 	GtkWidget *button_outgoing_smtp_servers;
+	GtkWidget *checkbox_offline_sync;
 	
 	GtkWidget *signature_dialog;
 
@@ -792,6 +793,20 @@
 	g_signal_connect (G_OBJECT (priv->button_outgoing_smtp_servers), "clicked",
         	G_CALLBACK (on_button_outgoing_smtp_servers), self);
 
+	/* offline sync checkbox: */
+	if (!priv->checkbox_offline_sync) {
+		priv->checkbox_offline_sync = hildon_check_button_new (MODEST_EDITABLE_SIZE);
+		hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_offline_sync), 
+			FALSE);
+		gtk_button_set_label (GTK_BUTTON (priv->checkbox_offline_sync),
+				      _("mcen_fi_advsetup_offline_sync"));
+		gtk_button_set_alignment (GTK_BUTTON (priv->checkbox_offline_sync), 0.0, 0.5);
+	}
+	gtk_widget_show (priv->checkbox_offline_sync);
+	gtk_box_pack_start (GTK_BOX (box), priv->checkbox_offline_sync, 
+			    FALSE, FALSE, 0);
+	connect_for_modified (self, priv->checkbox_offline_sync);
+
 	gtk_widget_show (GTK_WIDGET (box));
 
 	return GTK_WIDGET (box);
@@ -1176,6 +1191,7 @@
 	if (incoming_account) {
 		const gchar *username, *password, *hostname, *proto_str, *account_title;
 		gchar *proto_name, *title;
+                gboolean offline_sync;
 		ModestProtocolType incoming_protocol;
 
 		if (!modest_protocol_registry_protocol_type_has_leave_on_server (protocol_registry,
@@ -1191,6 +1207,8 @@
 		hostname = modest_server_account_settings_get_hostname (incoming_account);
 		username = modest_server_account_settings_get_username (incoming_account);
 		password = modest_server_account_settings_get_password (incoming_account);
+                offline_sync = modest_server_account_settings_get_offline_sync (incoming_account);
+
 		gtk_entry_set_text( GTK_ENTRY (priv->entry_user_username),
 				    null_means_empty (username));
 		gtk_entry_set_text( GTK_ENTRY (priv->entry_user_password), 
@@ -1199,6 +1217,8 @@
 		gtk_entry_set_text( GTK_ENTRY (priv->entry_incomingserver), 
 				    null_means_empty (hostname));
 
+                hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_offline_sync), offline_sync);
+
 		/* Load security settings */
 		modest_security_options_view_load_settings (
 			    MODEST_SECURITY_OPTIONS_VIEW (priv->incoming_security), 
@@ -1322,6 +1342,11 @@
 	password = gtk_entry_get_text (GTK_ENTRY (priv->entry_user_password));
 	modest_server_account_settings_set_password (store_settings, password);
 
+	/* Save offline sync setting: */
+	modest_server_account_settings_set_offline_sync
+		(store_settings, 
+		 hildon_check_button_get_active(HILDON_CHECK_BUTTON(priv->checkbox_offline_sync)));
+
 	/* Save security settings */
 	modest_security_options_view_save_settings (MODEST_SECURITY_OPTIONS_VIEW (priv->incoming_security), 
 						    priv->settings);
diff -r -u original/modest-account-mgr-helpers.c changed/modest-account-mgr-helpers.c
--- original/modest-account-mgr-helpers.c	2010-03-06 16:04:49.464450074 +0000
+++ changed/modest-account-mgr-helpers.c	2010-03-10 20:26:00.196189823 +0000
@@ -458,6 +458,7 @@
 	ModestProtocol *protocol;
 	ModestProtocolRegistry *registry;
 	gchar *hostname, *username, *pwd, *uri, *proto, *auth, *sec;
+        gboolean offline_sync;
 
 	if (!modest_account_mgr_account_exists (self, name, TRUE)) {
 		g_warning ("%s account %s does not exist", __FUNCTION__, name);
@@ -535,6 +536,11 @@
 	if (hostname)
 		modest_server_account_settings_set_hostname (settings, hostname);
 
+        offline_sync = modest_account_mgr_get_bool (self, name, 
+                                       		    MODEST_ACCOUNT_OFFLINE_SYNC, TRUE);
+        if (offline_sync)
+            modest_server_account_settings_set_offline_sync (settings, TRUE);
+
 	if (!uri) {
 		if (!username || !hostname) {
 			g_free (username);
@@ -584,6 +590,7 @@
 		gint port;
 		const gchar *auth_protocol_name;
 		const gchar *security_name;
+                gboolean offline_sync;
 
 		hostname = null_means_empty (modest_server_account_settings_get_hostname (settings));
 		username = null_means_empty (modest_server_account_settings_get_username (settings));
@@ -595,6 +602,7 @@
 		protocol = modest_protocol_registry_get_protocol_by_type (protocol_registry,
 									  modest_server_account_settings_get_security_protocol (settings));
 		security_name = modest_protocol_get_name (protocol);
+                offline_sync = modest_server_account_settings_get_offline_sync (settings);
 
 		has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_HOSTNAME, 
 							    hostname, TRUE);
@@ -618,6 +626,10 @@
 			(has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_SECURITY,
 									   security_name,
 									   TRUE));
+		if (!has_errors)
+			(has_errors = !modest_account_mgr_set_bool (self, account_name, MODEST_ACCOUNT_OFFLINE_SYNC,
+									    offline_sync,
+									    TRUE));
 	} else {
 		const gchar *uri = modest_server_account_settings_get_uri (settings);
 		has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_URI,
diff -r -u original/modest-defs.h changed/modest-defs.h
--- original/modest-defs.h	2010-03-06 16:04:52.433428689 +0000
+++ changed/modest-defs.h	2010-03-06 09:24:20.856243727 +0000
@@ -222,6 +222,8 @@
 
 #define MODEST_ACCOUNT_LIMIT_RETRIEVE	 "limit-retrieve"	     /* int */
 
+#define MODEST_ACCOUNT_OFFLINE_SYNC      "offline_sync"      /* boolean */
+
 #define MODEST_ACCOUNT_SECURITY "security"
 #define MODEST_ACCOUNT_SECURITY_VALUE_NONE "none"
 #define MODEST_ACCOUNT_SECURITY_VALUE_NORMAL "normal" /* Meaning "Normal (TLS)", as in our UI spec. */ 
Only in changed/: modest-marshal.c
Only in changed/: modest-marshal.h
diff -r -u original/modest-server-account-settings.c changed/modest-server-account-settings.c
--- original/modest-server-account-settings.c	2010-03-06 16:04:49.476445066 +0000
+++ changed/modest-server-account-settings.c	2010-03-06 09:24:46.824278348 +0000
@@ -48,6 +48,7 @@
 	ModestProtocolType auth_protocol;
 	gchar *account_name;
 	gchar *uri;
+	gboolean offline_sync;
 };
 
 #define MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE(o)     (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
@@ -112,6 +113,7 @@
 	priv->auth_protocol = MODEST_PROTOCOLS_AUTH_NONE;
 	priv->account_name = NULL;
 	priv->uri = NULL;
+	priv->offline_sync = FALSE;
 }
 
 static void   
@@ -368,3 +370,26 @@
 	priv->auth_protocol = auth_protocol;
 }
 
+gboolean 
+modest_server_account_settings_get_offline_sync (ModestServerAccountSettings *settings)
+{
+	ModestServerAccountSettingsPrivate *priv;
+
+	g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), 0);
+
+	priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
+	return priv->offline_sync;
+}
+
+void   
+modest_server_account_settings_set_offline_sync (ModestServerAccountSettings *settings,
+						 gboolean offline_sync)
+{
+	ModestServerAccountSettingsPrivate *priv;
+
+	g_return_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings));
+
+	priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
+	priv->offline_sync = offline_sync;
+}
+
diff -r -u original/modest-server-account-settings.h changed/modest-server-account-settings.h
--- original/modest-server-account-settings.h	2010-03-06 16:04:52.437437775 +0000
+++ changed/modest-server-account-settings.h	2010-03-06 09:24:21.287262098 +0000
@@ -260,6 +260,26 @@
 void modest_server_account_settings_set_account_name (ModestServerAccountSettings *settings,
 						      const gchar *account_name);
 
+/**
+ * modest_account_settings_get_offline_sync:
+ * @settings: a #ModestAccountSettings
+ *
+ * obtains if we should synchronise the account for offline use
+ *
+ * Returns: a #gboolean
+ */
+gboolean modest_server_account_settings_get_offline_sync (ModestServerAccountSettings *settings);
+					      
+/**
+ * modest_account_settings_set_offline_sync:
+ * @settings: a #ModestAccountSettings
+ * @offline_sync: a #gboolean
+ *
+ * if set, mails in these folders will be downloaded for offline reading
+ */
+void modest_server_account_settings_set_offline_sync (ModestServerAccountSettings *settings, 
+						      gboolean offline_sync);
+
 
 G_END_DECLS
 
diff -r -u original/modest-tny-account.c changed/modest-tny-account.c
--- original/modest-tny-account.c	2010-03-06 16:04:49.476445066 +0000
+++ changed/modest-tny-account.c	2010-03-06 09:24:46.828280545 +0000
@@ -207,6 +207,7 @@
 /* Camel options: */
 
 #define MODEST_ACCOUNT_OPTION_SSL "use_ssl"
+#define MODEST_ACCOUNT_OPTION_OFFLINE_SYNC "offline_sync"
 
 
 		
@@ -246,6 +247,7 @@
 		/* Set camel-specific options: */		
 		/* Enable secure connection settings: */
 		TnyPair *option_security = NULL;
+		TnyPair *option_offline_sync = NULL;
 		const gchar* auth_mech_name = NULL;
 		ModestProtocolType protocol_type;
 		ModestProtocol *protocol;
@@ -258,6 +260,7 @@
 		const gchar *username;
 		const gchar *hostname;
 		guint port;
+		gboolean offline_sync;
 
 		/* First of all delete old options */
 		tny_camel_account_clear_options (TNY_CAMEL_ACCOUNT (tny_account));
@@ -269,6 +272,13 @@
 		protocol = modest_protocol_registry_get_protocol_by_type (protocol_registry, protocol_type);
 		security = modest_protocol_registry_get_protocol_by_type (protocol_registry, security_type);
 		auth_protocol = modest_protocol_registry_get_protocol_by_type (protocol_registry, auth_protocol_type);
+		offline_sync = modest_server_account_settings_get_offline_sync (server_settings);
+
+		if (offline_sync) {
+			option_offline_sync = tny_pair_new (MODEST_ACCOUNT_OPTION_OFFLINE_SYNC, "");
+			tny_camel_account_add_option (TNY_CAMEL_ACCOUNT (tny_account), option_offline_sync);
+			g_object_unref (option_offline_sync);
+		}
 
 		security_option_string = modest_protocol_get (security, MODEST_PROTOCOL_SECURITY_ACCOUNT_OPTION);
 		if (security_option_string) {
@@ -575,7 +585,7 @@
 	tny_account_set_connection_policy (tny_account, policy);
 	g_object_unref (policy);
 
-        modest_tny_account_set_parent_modest_account_name_for_server_account (tny_account,
+	modest_tny_account_set_parent_modest_account_name_for_server_account (tny_account,
 									      account_name);
 	g_object_unref (server_settings);
 	g_object_unref (settings);

