From b378d055f2fc6427e9baf3d1a8397b8f0fa18b95 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Tamotsu Date: Mon, 19 Jul 2004 21:44:23 +0000 Subject: [PATCH] Fix #1548. (The first variant, with $imap_headers specifying headers that are downloaded in addition to the set required for mutt to work properly.) --- globals.h | 1 + imap/message.c | 10 +++++----- init.h | 9 +++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/globals.h b/globals.h index 4f3adbb5..15ad2491 100644 --- a/globals.h +++ b/globals.h @@ -55,6 +55,7 @@ WHERE char *Hostname; #ifdef USE_IMAP WHERE char *ImapAuthenticators INITVAL (NULL); WHERE char *ImapDelimChars INITVAL (NULL); +WHERE char *ImapHeaders; WHERE char *ImapHomeNamespace INITVAL (NULL); WHERE char *ImapPass INITVAL (NULL); WHERE char *ImapUser INITVAL (NULL); diff --git a/imap/message.c b/imap/message.c index 15d0fa55..5d302592 100644 --- a/imap/message.c +++ b/imap/message.c @@ -55,19 +55,19 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend) IMAP_HEADER h; int rc, mfhrc, oldmsgcount; int fetchlast = 0; - const char *want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO REPLY-TO LINES X-LABEL"; + const char *want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES X-LABEL"; ctx = idata->ctx; if (mutt_bit_isset (idata->capabilities,IMAP4REV1)) { - snprintf (hdrreq, sizeof (hdrreq), "BODY.PEEK[HEADER.FIELDS (%s)]", - want_headers); + snprintf (hdrreq, sizeof (hdrreq), "BODY.PEEK[HEADER.FIELDS (%s %s)]", + want_headers, ImapHeaders); } else if (mutt_bit_isset (idata->capabilities,IMAP4)) { - snprintf (hdrreq, sizeof (hdrreq), "RFC822.HEADER.LINES (%s)", - want_headers); + snprintf (hdrreq, sizeof (hdrreq), "RFC822.HEADER.LINES (%s %s)", + want_headers, ImapHeaders); } else { /* Unable to fetch headers for lower versions */ diff --git a/init.h b/init.h index 59e1bf91..cf40ff3b 100644 --- a/init.h +++ b/init.h @@ -808,6 +808,15 @@ struct option_t MuttVars[] = { ** connecting to IMAP servers. */ # endif + { "imap_headers", DT_STR, R_INDEX, UL &ImapHeaders, UL 0}, + /* + ** .pp + ** Mutt requests these header fields in addition to the default headers + ** ("DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE + ** CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES X-LABEL") from IMAP + ** servers before displaying the index menu. You may want to add more + ** headers for spam detection. \fBNote:\fP This is a space separated list. + */ { "imap_home_namespace", DT_STR, R_NONE, UL &ImapHomeNamespace, UL 0}, /* ** .pp -- 2.40.0