diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 5eb4081..81a16ed 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -1039,11 +1039,6 @@ mail_backend_constructed (GObject *object)
 		priv->session, "flush-outbox",
 		G_CALLBACK (mail_send), priv->session);
 
-	g_object_bind_property (
-		shell, "online",
-		priv->session, "online",
-		G_BINDING_SYNC_CREATE);
-
 	/* Propagate "activity-added" signals from
 	 * the mail session to the shell backend. */
 	g_signal_connect_swapped (
diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c
index c86de6a..4af8907 100644
--- a/mail/e-mail-ui-session.c
+++ b/mail/e-mail-ui-session.c
@@ -540,8 +540,16 @@ mail_ui_session_constructed (GObject *object)
 	EMFolderTreeModel *folder_tree_model;
 	ESourceRegistry *registry;
 	EMailSession *session;
+	EShell *shell;
 
 	session = E_MAIL_SESSION (object);
+	shell = e_shell_get_default ();
+
+	/* synchronize online state first, before any CamelService is created */
+	g_object_bind_property (
+		shell, "online",
+		session, "online",
+		G_BINDING_SYNC_CREATE);
 
 	priv = E_MAIL_UI_SESSION_GET_PRIVATE (object);
 	priv->account_store = e_mail_account_store_new (session);
