--- evolution/mail/mail-send-recv.c.~1.97.~	2005-01-31 10:53:01.000000000 +0100
+++ evolution/mail/mail-send-recv.c	2005-04-08 02:18:39.000000000 +0200
@@ -766,6 +766,7 @@
 	EAccount *account;
 	int period;		/* in seconds */
 	int timeout_id;
+	int idle_id;
 };
 
 static GHashTable *auto_active;
@@ -785,6 +786,16 @@
 	return TRUE;
 }
 
+static gboolean
+auto_startup(void *data)
+{
+	struct _auto_data *info = data;
+
+	auto_timeout(info);
+	info->idle_id = 0;
+	return FALSE;
+}
+
 static void
 auto_account_removed(EAccountList *eal, EAccount *ea, void *dummy)
 {
@@ -803,6 +814,8 @@
 {
 	if (info->timeout_id)
 		g_source_remove(info->timeout_id);
+	if (info->idle_id)
+		g_source_remove(info->idle_id);
 	g_free(info);
 }
 
@@ -824,8 +837,10 @@
 		info->timeout_id = 0;
 	}
 	info->period = period;
-	if (check && info->timeout_id == 0)
+	if (check && info->timeout_id == 0) {
 		info->timeout_id = g_timeout_add(info->period*1000, auto_timeout, info);
+		info->idle_id = g_idle_add(auto_startup, info);
+	}
 }
 
 static void
