--- a/camel/camel-mime-parser.c 2006-05-03 14:59:26.000000000 +0100 +++ a/camel/camel-mime-parser.c 2007-10-23 00:01:13.000000000 +0100 @@ -51,7 +51,7 @@ #define c(x) #define d(x) -/*#define PRESERVE_HEADERS*/ +#define PRESERVE_HEADERS /*#define PURIFY*/ @@ -1227,14 +1227,15 @@ h(printf("got line part: '%.*s'\n", inptr-1-start, start)); /* got a line, strip and add it, process it */ s->midline = FALSE; + + /* check for end of headers */ + if (start+1 == inptr) + goto header_done; #ifdef PRESERVE_HEADERS header_append(s, start, inptr); #else header_append(s, start, inptr-1); #endif - /* check for end of headers */ - if (s->outbuf == s->outptr) - goto header_done; /* check for continuation/compress headers, we have atleast 1 char here to work with */ if (inptr[0] == ' ' || inptr[0] == '\t') {