From: Art Cancro Date: Wed, 22 Aug 2007 19:19:19 +0000 (+0000) Subject: Changed the way messages and headers are X-Git-Tag: v7.86~3137 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8a6b80f677d6a94305b2ba63dd6404b9ea75e6fb Changed the way messages and headers are fetched from disk during IMAP BODY fetch operations. The iPhone does UID FETCH (BODY.PEEK[HEADER] BODY.PEEK[TEXT]) and then gets all bent out of shape when it doesn't see the Content-type: header where it expects it. --- diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/modules/imap/imap_fetch.c index 675b642b3..9f08131df 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/modules/imap/imap_fetch.c @@ -587,9 +587,19 @@ void imap_fetch_body(long msgnum, char *item, int is_peek) { lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, IsEmptyStr(section) ? "(empty)" : ""); - if (!strncasecmp(section, "HEADER", 6)) { - need_body = 0; - } + + /* + * We used to have this great optimization in place that would avoid + * fetching the entire RFC822 message from disk if the client was only + * asking for the headers. Unfortunately, fetching only the Citadel + * headers omits "Content-type:" and this behavior breaks the iPhone + * email client. So we have to fetch the whole message from disk. The + * + * if (!strncasecmp(section, "HEADER", 6)) { + * need_body = 0; + * } + * + */ /* Burn the cache if we don't have the same section of the * same message again.