diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index b26bbe2..5598382 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -1089,7 +1089,10 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
 		match = g_ptr_array_new();
 	} else {
 		/* Load the folder results from the DB. */
-		match = camel_vee_summary_get_ids ((CamelVeeSummary *)folder->summary, u.hash);
+		if (!strstr(vf->expression, "match-threads"))
+			match = camel_vee_summary_get_ids ((CamelVeeSummary *)folder->summary, u.hash);
+		else
+			match = NULL;
 		d(printf("len = %d %d for %s %s\n", match ? match->len:0, rebuilded, source->full_name, shash));
 		if (!match) {
 			char *expr;
@@ -1537,6 +1540,14 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
 	}
 
 	camel_vee_folder_hash_folder(sub, hash);
+	if (strstr(vf->expression, "match-threads")) {
+		CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
+		if (g_list_find(vf->priv->folders_changed, sub) == NULL)
+			vf->priv->folders_changed = g_list_prepend(vf->priv->folders_changed, sub);
+		CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
+		CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
+		return;
+	}
 
 
 	/* Lookup anything before we lock anything, to avoid deadlock with build_folder */
