[dovecot-cvs] dovecot/src/lib-index mailbox-list-index-sync.c, 1.10, 1.11

tss at dovecot.org tss at dovecot.org
Fri Mar 16 02:18:15 EET 2007


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv32219

Modified Files:
	mailbox-list-index-sync.c 
Log Message:
We didn't always expunge deleted mailboxes from mail index.



Index: mailbox-list-index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mailbox-list-index-sync.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mailbox-list-index-sync.c	15 Mar 2007 23:30:35 -0000	1.10
+++ mailbox-list-index-sync.c	16 Mar 2007 00:18:13 -0000	1.11
@@ -639,6 +639,7 @@
 	struct mailbox_list_record *recs;
 	const struct mailbox_list_sync_record *sync_recs;
 	unsigned int i, j, count;
+	uint32_t seq;
 
 	i_assert(sync_dir->offset != 0);
 
@@ -668,8 +669,17 @@
 			i_assert(j < dir->count);
 		}
 
-		if (!sync_recs[i].seen)
+		if (!sync_recs[i].seen) {
 			recs[j].deleted = TRUE;
+
+			/* expunge from mail index */
+			if (mail_index_lookup_uid_range(ctx->mail_view,
+							sync_recs[i].uid,
+							sync_recs[i].uid,
+							&seq, &seq) == 0 &&
+			    seq != 0)
+				mail_index_expunge(ctx->trans, seq);
+		}
 	}
 	if (ctx->index->mmap_disable) {
 		uoff_t offset, old_offset;



More information about the dovecot-cvs mailing list