hash_destroy (&ctx->id_hash, NULL);
mutt_clear_threads (ctx);
for (i = 0; i < ctx->msgcount; i++)
- mutt_free_header (&ctx->hdrs[i]);
+ header_delete(&ctx->hdrs[i]);
p_delete(&ctx->hdrs);
p_delete(&ctx->v2r);
if (ctx->id_hash && ctx->hdrs[i]->env->message_id)
hash_delete (ctx->id_hash, ctx->hdrs[i]->env->message_id,
ctx->hdrs[i], NULL);
- mutt_free_header (&ctx->hdrs[i]);
+ header_delete(&ctx->hdrs[i]);
}
}
#undef this_body
return (0);
#endif
}
+
+void mutt_parse_mime_message (CONTEXT * ctx, HEADER * cur)
+{
+ MESSAGE *msg;
+ int flags = 0;
+
+ do {
+ if (cur->content->type != TYPEMESSAGE
+ && cur->content->type != TYPEMULTIPART)
+ break; /* nothing to do */
+
+ if (cur->content->parts)
+ break; /* The message was parsed earlier. */
+
+ if ((msg = mx_open_message (ctx, cur->msgno))) {
+ mutt_parse_part (msg->fp, cur->content);
+
+ cur->security = crypt_query (cur->content);
+
+ mx_close_message (&msg);
+ }
+ } while (0);
+ mutt_count_body_parts (cur, flags | M_PARTS_RECOUNT);
+}