nb.parts = NULL;
nb.hdr = NULL;
nb.aptr = NULL;
+ nb.mime_headers = NULL;
lazy_realloc(&d, *off + sizeof (BODY));
memcpy(d + *off, &nb, sizeof (BODY));
time_t stamp; /* time stamp of last
* encoding update.
*/
-
+
+ struct envelope *mime_headers; /* memory hole protected headers */
+
unsigned int type : 4; /* content-type primary type */
unsigned int encoding : 3; /* content-transfer-encoding */
unsigned int disposition : 2; /* content-disposition */
mutt_free_header(&b->hdr);
}
+ mutt_free_envelope (&b->mime_headers);
+
if (b->parts)
mutt_free_body (&b->parts);
BODY *mutt_read_mime_header (FILE *fp, int digest)
{
BODY *p = mutt_new_body();
+ ENVELOPE *e = mutt_new_envelope ();
char *c;
char *line = safe_malloc (LONG_STRING);
size_t linelen = LONG_STRING;
}
}
#endif
+ else
+ {
+ if (mutt_parse_rfc822_line (e, NULL, line, c, 0, 0, 0, NULL))
+ p->mime_headers = e;
+ }
}
p->offset = ftello (fp); /* Mark the start of the real data */
if (p->type == TYPETEXT && !p->subtype)
FREE (&line);
+ if (p->mime_headers)
+ rfc2047_decode_envelope (p->mime_headers);
+ else
+ mutt_free_envelope (&e);
+
return (p);
}