[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c,1.55,1.56

cras at dovecot.org cras at dovecot.org
Fri Sep 10 14:25:35 EEST 2004


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

Modified Files:
	index-mail.c 
Log Message:
When using cached message_parts, update the header size with mbox since it
may change. Fixes BODY[1] etc. fetches giving corrupted replies.



Index: index-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- index-mail.c	4 Sep 2004 12:44:14 -0000	1.55
+++ index-mail.c	10 Sep 2004 11:25:33 -0000	1.56
@@ -36,6 +36,7 @@
 {
 	struct mail_cache_field *cache_fields = mail->ibox->cache_fields;
 	struct message_part *part;
+	const struct message_size *new_hdr_size;
 	buffer_t *part_buf;
 	const char *error;
 
@@ -49,10 +50,21 @@
 		return NULL;
 	}
 
+	if (!mail->ibox->unreliable_headers)
+		new_hdr_size = NULL;
+	else {
+		if (!mail->data.hdr_size_set) {
+			if (index_mail_parse_headers(mail, NULL) < 0)
+				return NULL;
+		}
+
+		new_hdr_size = &mail->data.hdr_size;
+	}
+
 	part = message_part_deserialize(mail->pool,
 					buffer_get_data(part_buf, NULL),
 					buffer_get_used_size(part_buf),
-					&error);
+					new_hdr_size, &error);
 	t_pop();
 
 	if (part == NULL) {



More information about the dovecot-cvs mailing list