From 22d4ed6e83f28f1d13812b739a1b5bad755da81a Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Mon, 24 Apr 2000 13:09:33 +0000 Subject: [PATCH] Fall back to INTERNALDATE when Date header isn't present. From Brendan. --- imap/message.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imap/message.c b/imap/message.c index fe15b45e5..d1cff0773 100644 --- a/imap/message.c +++ b/imap/message.c @@ -233,7 +233,6 @@ int imap_read_headers (CONTEXT *ctx, int msgbegin, int msgend) ctx->hdrs[ctx->msgcount] = mutt_new_header (); ctx->hdrs[ctx->msgcount]->index = ctx->msgcount; - ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno], 0, 0); ploc = ftell (fp); ctx->hdrs[msgno]->read = h->read; ctx->hdrs[msgno]->old = h->old; @@ -242,9 +241,14 @@ int imap_read_headers (CONTEXT *ctx, int msgbegin, int msgend) ctx->hdrs[msgno]->replied = h->replied; ctx->hdrs[msgno]->changed = h->changed; ctx->hdrs[msgno]->received = h->received; - ctx->hdrs[msgno]->content->length = h->content_length; ctx->hdrs[msgno]->data = (void *) (h->data); + /* NOTE: if Date: header is missing, mutt_read_rfc822_header depends + * on h->received being set */ + ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno], 0, 0); + /* content built as a side-effect of mutt_read_rfc822_header */ + ctx->hdrs[msgno]->content->length = h->content_length; + mx_update_context (ctx); /* increments ->msgcount */ h0 = h; -- 2.40.0