dovecot-1.0: mbox fix for RFC822.TEXT also.

dovecot at dovecot.org dovecot at dovecot.org
Tue Dec 11 20:58:15 EET 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/2f4242afee68
changeset: 5490:2f4242afee68
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Dec 11 20:58:11 2007 +0200
description:
mbox fix for RFC822.TEXT also.

diffstat:

1 file changed, 7 insertions(+), 9 deletions(-)
src/imap/imap-fetch-body.c |   16 +++++++---------

diffs (44 lines):

diff -r c19fab2d24f7 -r 2f4242afee68 src/imap/imap-fetch-body.c
--- a/src/imap/imap-fetch-body.c	Tue Dec 11 20:47:30 2007 +0200
+++ b/src/imap/imap-fetch-body.c	Tue Dec 11 20:58:11 2007 +0200
@@ -883,24 +883,22 @@ static int fetch_rfc822(struct imap_fetc
 static int fetch_rfc822(struct imap_fetch_context *ctx, struct mail *mail,
 			void *context __attr_unused__)
 {
-	struct message_size size;
+	struct message_size hdr_size, body_size;
 	const char *str;
 
-	ctx->cur_input = mail_get_stream(mail, NULL, NULL);
+	ctx->cur_input = mail_get_stream(mail, &hdr_size, &body_size);
 	if (ctx->cur_input == NULL)
 		return -1;
 
-	size.virtual_size = mail_get_virtual_size(mail);
-	size.physical_size = mail_get_physical_size(mail);
-	if (size.virtual_size == (uoff_t)-1 || size.physical_size == (uoff_t)-1)
-		return -1;
+	/* FIXME: Same problem as with fetch_body() */
+	message_size_add(&body_size, &hdr_size);
 
 	i_stream_ref(ctx->cur_input);
 	ctx->update_partial = FALSE;
 
 	if (ctx->cur_offset == 0) {
 		str = t_strdup_printf(" RFC822 {%"PRIuUOFF_T"}\r\n",
-				      size.virtual_size);
+				      body_size.virtual_size);
 		if (ctx->first) {
 			str++; ctx->first = FALSE;
 		}
@@ -908,8 +906,8 @@ static int fetch_rfc822(struct imap_fetc
 			return -1;
 	}
 
-        ctx->cur_size = size.virtual_size;
-	return fetch_stream(ctx, &size);
+        ctx->cur_size = body_size.virtual_size;
+	return fetch_stream(ctx, &body_size);
 }
 
 static int fetch_rfc822_header(struct imap_fetch_context *ctx,


More information about the dovecot-cvs mailing list