[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.137, 1.138

cras at dovecot.org cras at dovecot.org
Mon Mar 14 16:32:50 EET 2005


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv12824/lib-storage/index/mbox

Modified Files:
	mbox-sync.c 
Log Message:
When writing the dummy message after all messages were expunged from mbox,
the UIDVALIDITY value was set to 0 if X-IMAP/X-IMAPbase header wasn't read. 
This caused the next parsing to treat the header invalid and didn't
recognize it as dummy message.



Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- mbox-sync.c	18 Jan 2005 23:47:40 -0000	1.137
+++ mbox-sync.c	14 Mar 2005 14:32:48 -0000	1.138
@@ -955,6 +955,11 @@
 static int mbox_write_dummy(struct mbox_sync_context *sync_ctx)
 {
 	string_t *str;
+	unsigned int uid_validity;
+
+	uid_validity = sync_ctx->base_uid_validity != 0 ?
+		sync_ctx->base_uid_validity : sync_ctx->hdr->uid_validity;
+	i_assert(uid_validity != 0);
 
 	str = t_str_new(1024);
 	str_printfa(str, "%sDate: %s\n"
@@ -968,8 +973,7 @@
                     mbox_from_create("MAILER_DAEMON", ioloop_time),
 		    message_date_create(ioloop_time),
 		    my_hostname, dec2str(ioloop_time), my_hostname,
-		    sync_ctx->base_uid_validity,
-		    sync_ctx->next_uid-1);
+		    uid_validity, sync_ctx->next_uid-1);
 
 	if (pwrite_full(sync_ctx->fd, str_data(str), str_len(str), 0) < 0) {
 		if (!ENOSPACE(errno)) {



More information about the dovecot-cvs mailing list