#include "mutt/mutt.h"
#include "body.h"
#include "email.h"
+#include "envelope.h"
#include "mime.h"
#include "parameter.h"
mutt_email_free(&b->email);
}
+ mutt_env_free(&b->mime_headers);
mutt_body_free(&b->parts);
FREE(&b);
}
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 */
struct Body *mutt_read_mime_header(FILE *fp, bool digest)
{
struct Body *p = mutt_body_new();
+ struct Envelope *env = mutt_env_new();
char *c = NULL;
char *line = mutt_mem_malloc(LONG_STRING);
size_t linelen = LONG_STRING;
}
}
#endif
+ else
+ {
+ if (mutt_rfc822_parse_line(env, NULL, line, c, false, false, false))
+ p->mime_headers = env;
+ }
}
p->offset = ftello(fp); /* Mark the start of the real data */
if (p->type == TYPE_TEXT && !p->subtype)
FREE(&line);
+ if (p->mime_headers)
+ rfc2047_decode_envelope(p->mime_headers);
+ else
+ mutt_env_free(&env);
+
return p;
}