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

Re: Can no longer open an IMAP mailbox



On Thursday, 22 July 2004 at 00:13, Vincent Lefevre wrote:
> I submitted a bug several hours ago, but it seems that the Mutt BTS
> is down, so...
> 
> I've just upgraded from the CVS, and Mutt can no longer read an IMAP
> mailbox. I get the following error:

This is caused by the new $imap_headers variable. I've attached a
quick fix, but that variable may need sanitizing later - it's still
possible to cause a mailbox open to fail with
set imap_headers=" "
for example.

Index: message.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/message.c,v
retrieving revision 3.8
diff -u -p -u -p -r3.8 message.c
--- message.c   20 Jul 2004 08:17:21 -0000      3.8
+++ message.c   21 Jul 2004 22:23:20 -0000
@@ -61,13 +61,13 @@ int imap_read_headers (IMAP_DATA* idata,
 
   if (mutt_bit_isset (idata->capabilities,IMAP4REV1))
   {
-    snprintf (hdrreq, sizeof (hdrreq), "BODY.PEEK[HEADER.FIELDS (%s %s)]", 
-      want_headers, ImapHeaders); 
+    snprintf (hdrreq, sizeof (hdrreq), "BODY.PEEK[HEADER.FIELDS (%s%s%s)]", 
+             want_headers, ImapHeaders ? " " : "", ImapHeaders ? ImapHeaders : 
""); 
   } 
   else if (mutt_bit_isset (idata->capabilities,IMAP4))
   {
-    snprintf (hdrreq, sizeof (hdrreq), "RFC822.HEADER.LINES (%s %s)", 
-      want_headers, ImapHeaders);
+    snprintf (hdrreq, sizeof (hdrreq), "RFC822.HEADER.LINES (%s%s%s)", 
+             want_headers, ImapHeaders ? " " : "", ImapHeaders ? ImapHeaders : 
"");
   }
   else
   {    /* Unable to fetch headers for lower versions */

Attachment: pgpHoFHJL0ITr.pgp
Description: PGP signature