<<< Date Index >>>     <<< Thread Index >>>

Re: #1548: S/MIME-verification bug (409 days old)



Hi,

On Fri, Jul 16, 2004 at 04:25:05PM +0200, Thomas Glanzmann wrote:
> > -  const char *want_headers
> > +  const char *want_headers
> 
> ... maybe you should also add the new spam header as well when submit
> the patch upstream.

Well, then, we have to make a new variable. Here is two untested patches.
(Header cache mechanism should dump these values and check them
before restoring?)

-- 
tamo
Index: globals.h
===================================================================
RCS file: /home/roessler/cvs/mutt/globals.h,v
retrieving revision 3.9
diff -u -r3.9 globals.h
--- globals.h   14 Jul 2004 04:16:58 -0000      3.9
+++ globals.h   16 Jul 2004 22:18:06 -0000
@@ -55,6 +55,7 @@
 #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);
Index: init.h
===================================================================
RCS file: /home/roessler/cvs/mutt/init.h,v
retrieving revision 3.54
diff -u -r3.54 init.h
--- init.h      15 Jul 2004 08:08:32 -0000      3.54
+++ init.h      16 Jul 2004 22:18:07 -0000
@@ -808,6 +808,15 @@
   ** 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
Index: imap/message.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/message.c,v
retrieving revision 3.6
diff -u -r3.6 message.c
--- imap/message.c      13 Apr 2004 15:10:38 -0000      3.6
+++ imap/message.c      16 Jul 2004 22:18:08 -0000
@@ -55,19 +55,19 @@
   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 */
Index: globals.h
===================================================================
RCS file: /home/roessler/cvs/mutt/globals.h,v
retrieving revision 3.9
diff -u -r3.9 globals.h
--- globals.h   14 Jul 2004 04:16:58 -0000      3.9
+++ globals.h   16 Jul 2004 22:18:48 -0000
@@ -55,6 +55,7 @@
 #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);
Index: init.h
===================================================================
RCS file: /home/roessler/cvs/mutt/init.h,v
retrieving revision 3.54
diff -u -r3.54 init.h
--- init.h      15 Jul 2004 08:08:32 -0000      3.54
+++ init.h      16 Jul 2004 22:18:50 -0000
@@ -808,6 +808,14 @@
   ** connecting to IMAP servers.
   */
 # endif
+  { "imap_headers",    DT_STR, R_INDEX, UL &ImapHeaders, UL "DATE FROM SUBJECT 
TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO 
REPLY-TO LINES X-LABEL"},
+  /*
+  ** .pp
+  ** Mutt requests these header fields from IMAP servers before displaying
+  ** the index menu. You may want to add more headers for spam detection.
+  ** \fBNOTE:\fP Don't remove any header from the default value unless you
+  ** really know what you are doing and your IMAP connection is too slow.
+  */
   { "imap_home_namespace",     DT_STR, R_NONE, UL &ImapHomeNamespace, UL 0},
   /*
   ** .pp
Index: imap/message.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/message.c,v
retrieving revision 3.6
diff -u -r3.6 message.c
--- imap/message.c      13 Apr 2004 15:10:38 -0000      3.6
+++ imap/message.c      16 Jul 2004 22:18:50 -0000
@@ -55,19 +55,18 @@
   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";
 
   ctx = idata->ctx;
 
   if (mutt_bit_isset (idata->capabilities,IMAP4REV1))
   {
     snprintf (hdrreq, sizeof (hdrreq), "BODY.PEEK[HEADER.FIELDS (%s)]", 
-      want_headers); 
+      ImapHeaders); 
   } 
   else if (mutt_bit_isset (idata->capabilities,IMAP4))
   {
     snprintf (hdrreq, sizeof (hdrreq), "RFC822.HEADER.LINES (%s)", 
-      want_headers);
+      ImapHeaders);
   }
   else
   {    /* Unable to fetch headers for lower versions */