Index: camel/camel-store.c
===================================================================
--- camel/camel-store.c	(revision 9729)
+++ camel/camel-store.c	(working copy)
@@ -700,6 +700,17 @@ camel_store_get_junk (CamelStore *store,
 		return camel_store_get_folder(store, CAMEL_VJUNK_NAME, 0, ex);
 }
 
+/**
+ * ignore_no_such_table_exception:
+ * Clears the exception 'ex' when it's the 'no such table' exception.
+ **/
+static void
+ignore_no_such_table_exception (CamelException *ex)
+{
+	if (ex && camel_exception_is_set (ex) && g_ascii_strncasecmp (camel_exception_get_description (ex), "no such table", 13) == 0)
+		camel_exception_clear (ex);
+}
+
 static void
 store_sync (CamelStore *store, int expunge, CamelException *ex)
 {
@@ -716,9 +727,10 @@ store_sync (CamelStore *store, int expun
 		for (i=0;i<folders->len;i++) {
 			folder = folders->pdata[i];
 			if (!CAMEL_IS_VEE_FOLDER(folder)
-			    && !camel_exception_is_set(&x))
+			    && !camel_exception_is_set(&x)) {
 				camel_folder_sync(folder, expunge, &x);
-			else if (CAMEL_IS_VEE_FOLDER(folder))
+				ignore_no_such_table_exception (&x);
+			} else if (CAMEL_IS_VEE_FOLDER(folder))
 				camel_vee_folder_sync_headers(folder, NULL); /* Literally don't care of vfolder exceptions */
 			camel_object_unref(folder);
 		}
Index: camel/ChangeLog
===================================================================
--- camel/ChangeLog	(revision 9729)
+++ camel/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-11-05  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #555979
+
+	* camel-store.c: (ignore_no_such_table_exception): New helper function.
+	* camel-store.c: (store_sync): Ignore 'no such table' exceptions.
+
 2008-10-31  Matthew Barnes  <mbarnes@redhat.com>
 
 	** Fixes part of bug #558727 (patch by Frederic van Starbmann)
