Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34305)
+++ ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2007-09-26  Johnny Jacob  <jjohnny@novell.com>
+
+	** Fix for #312106.
+	
+	* em-account-editor.c (emae_receive_options_item): Adding new
+	widget "Check mail at startup" to preference page.
+	* mail-send-recv.c (auto_online): Fetch mail based on
+	configuration.
+
 2007-09-21  Matthew Barnes  <mbarnes@redhat.com>
 
 	* Makefile.am:
Index: mail-send-recv.c
===================================================================
--- mail-send-recv.c	(revision 34235)
+++ mail-send-recv.c	(working copy)
@@ -1050,7 +1050,8 @@
 	accounts = mail_config_get_accounts ();
 	for (iter = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(iter);e_iterator_next(iter)) {
 		info  = g_object_get_data((GObject *)e_iterator_get(iter), "mail-autoreceive");
-		if (info && info->timeout_id)
+
+		if (info && info->timeout_id && e_account_get_bool(info->account, E_ACCOUNT_SOURCE_AUTO_CHECK_AT_STARTUP)) {
 			auto_timeout(info);
 	}
 }
Index: em-account-editor.c
===================================================================
--- em-account-editor.c	(revision 34235)
+++ em-account-editor.c	(working copy)
@@ -2039,7 +2039,7 @@
 emae_receive_options_item(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data)
 {
 	EMAccountEditor *emae = data;
-	GtkWidget *w, *box;
+	GtkWidget *w, *box, *vbox;
 	int row;
 
 	if (emae->priv->source.provider == NULL
@@ -2052,6 +2052,8 @@
 	/* We have to add the automatic mail check item with the rest of the receive options */
 	row = ((GtkTable *)parent)->nrows;
 
+	vbox = gtk_vbox_new (FALSE, 4);
+
 	box = gtk_hbox_new(FALSE, 4);
 	w = gtk_check_button_new_with_mnemonic (_("Automatically check for _new mail every"));
 	emae_account_toggle_widget(emae, (GtkToggleButton *)w, E_ACCOUNT_SOURCE_AUTO_CHECK);
@@ -2063,12 +2065,17 @@
 
 	w = gtk_label_new(_("minutes"));
 	gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, 0);
+	gtk_box_pack_start((GtkBox *)vbox, box, FALSE, FALSE, 0);
 
-	gtk_widget_show_all(box);
+	w = gtk_check_button_new_with_mnemonic (_("Automatica_lly check for new mail at startup"));
+	emae_account_toggle_widget(emae, (GtkToggleButton *)w, E_ACCOUNT_SOURCE_AUTO_CHECK_AT_STARTUP);
+	gtk_box_pack_end((GtkBox *)vbox, w, FALSE, FALSE, 0);
 
-	gtk_table_attach((GtkTable *)parent, box, 0, 2, row, row+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
+	gtk_widget_show_all(vbox);
 
-	return box;
+	gtk_table_attach((GtkTable *)parent, vbox, 0, 2, row, row+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
+
+	return vbox;
 }
 
 static GtkWidget *
