changeset 1953:a1c00aa3a078 HEAD

Add CRLF to end of FETCH BODY[HEADER.FIELDS (...)] always.
author Timo Sirainen <tss@iki.fi>
date Sun, 02 May 2004 16:05:53 +0300
parents 05f76fe32f0d
children 2f6e137cdc44
files src/imap/imap-fetch-body-section.c
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-fetch-body-section.c	Sun May 02 15:57:29 2004 +0300
+++ b/src/imap/imap-fetch-body-section.c	Sun May 02 16:05:53 2004 +0300
@@ -293,13 +293,11 @@
 
 	hdr_ctx = message_parse_header_init(input, NULL);
 	while ((hdr = message_parse_header_next(hdr_ctx)) != NULL) {
-		/* see if we want this field.
-		   we always want the end-of-headers line */
-		if (!hdr->eoh &&
-		    !ctx->match_func(ctx->fields, hdr->name, hdr->name_len))
+		/* see if we want this field. */
+		if (!ctx->match_func(ctx->fields, hdr->name, hdr->name_len))
 			continue;
 
-		if (!hdr->continued && !hdr->eoh) {
+		if (!hdr->continued) {
 			if (!fetch_header_append(ctx, hdr->name, hdr->name_len))
 				break;
 			if (!fetch_header_append(ctx, ": ", 2))
@@ -312,6 +310,16 @@
 				break;
 		}
 	}
+
+	/* FIXME: We'll just always add the end of headers mark now.
+	   mail-storage should rather include it in the header stream..
+	   however, not much of a problem since all non-broken mails have it.
+
+	   Also, Netscape 4.x seems to require this or it won't show the
+	   mail.. So if we do make this as RFC says, we'll need to add
+	   netscape-workaround. */
+	(void)fetch_header_append(ctx, "\r\n", 2);
+
 	message_parse_header_deinit(hdr_ctx);
 
 	i_assert(ctx->dest_size <= ctx->max_size);