[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-rewrite.c, 1.57, 1.58

cras at dovecot.org cras at dovecot.org
Fri Oct 28 18:18:52 EEST 2005


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

Modified Files:
	mbox-sync-rewrite.c 
Log Message:
If mail had more extra space in X-UID header than in X-Keywords header (but
X-Keywords existed), we broke when rewriting it.



Index: mbox-sync-rewrite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- mbox-sync-rewrite.c	28 Oct 2005 14:48:29 -0000	1.57
+++ mbox-sync-rewrite.c	28 Oct 2005 15:18:50 -0000	1.58
@@ -88,7 +88,12 @@
 
 	if (ctx->pseudo)
 		start_pos = ctx->hdr_pos[MBOX_HDR_X_IMAPBASE];
-	else {
+	else if (ctx->mail.space > 0) {
+		/* update the header using the existing offset.
+		   otherwise we might chose wrong header and just decrease
+		   the available space */
+		start_pos = ctx->mail.offset - ctx->hdr_offset;
+	} else {
 		/* Append at the end of X-Keywords header,
 		   or X-UID if it doesn't exist */
 		start_pos = ctx->hdr_pos[MBOX_HDR_X_KEYWORDS] != (size_t)-1 ?



More information about the dovecot-cvs mailing list