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

bug#1795: marked as done (mutt-1.5.4i: Failure to open Cyrus IMAP mailbox)



Your message dated Tue, 13 Apr 2004 17:13:23 +0200
with message-id <20040413151323.GH3813@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
and subject line bug#1795: mutt-1.5.4i: Failure to open Cyrus IMAP mailbox
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Herr der Kaefer
(administrator, GUUG bugs database)

--------------------------------------
Received: (at submit) by bugs.guug.de; 4 Feb 2004 15:55:06 +0000
>From bbell@xxxxxx Wed Feb 04 16:55:04 2004
Received: from ztxmail04.ztx.compaq.com ([161.114.1.208])
        by trithemius.gnupg.org with esmtp (Exim 3.35 #1 (Debian))
        id 1AoPMl-0002TH-00
        for <submit@xxxxxxxxxxxx>; Wed, 04 Feb 2004 16:55:03 +0100
Received: from mailrelay01.cac.cpqcorp.net (mailrelay01.cac.cpqcorp.net 
[16.47.132.152])
        by ztxmail04.ztx.compaq.com (Postfix) with ESMTP id 84DE3E837
        for <submit@xxxxxxxxxxxx>; Wed,  4 Feb 2004 09:56:40 -0600 (CST)
Received: from anw.zk3.dec.com (and.zk3.dec.com [16.140.64.3])
        by mailrelay01.cac.cpqcorp.net (Postfix) with ESMTP id 2E82C28F6
        for <submit@xxxxxxxxxxxx>; Wed,  4 Feb 2004 07:56:19 -0800 (PST)
Received: from zk3.dec.com by anw.zk3.dec.com (8.11.1/1.1.22.2/08Sep98-0251PM)
        id i14FucD0001742232; Wed, 4 Feb 2004 10:56:38 -0500 (EST)
Received: by zk3.dec.com (sSMTP sendmail emulation); Wed, 4 Feb 2004 10:56:20 
-0500
Date: Wed, 4 Feb 2004 10:56:20 -0500
From: Bob Bell <bbell@xxxxxxxxxxxxxxxxxxxxx>
To: submit@xxxxxxxxxxxx
Subject: mutt-1.5.4i: Failure to open Cyrus IMAP mailbox
Message-ID: <20040204155620.GF9397@xxxxxxxxxxx>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.4i
X-Spam-Status: No, hits=-4.4 required=4.0
        tests=AWL,UPPERCASE_25_50,USER_AGENT_MUTT
        version=2.55
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)

Package: mutt
Version: 1.5.4i
Severity: important

-- Please type your report below this line

I'm not an IMAP expert, but I had a problem opening a mail folder via
IMAP and looked into it.  I think this problem was caused by a system
administrator deleting some messages that had viruses in them.  This
seems to have caused Cyrus to respond with a FETCH syntax that mutt
isn't prepared to handle -- mutt fails to open the folder and then also
seems to get wedged.  The short illustration below of an interaction
with the imap server will hopefully illustrate this problem.  Messages
3274 and 3275 exhibit the problem; message 3276 seems okay.

To fix this problem, as it was preventing me from opening the folder in
mutt (which unfortunately was necessary to recover lost mail), I applied
the patch included below.  I don't want to vouch too much for this patch
because my unfamiliarity with the code and IMAP makes be unsure that it
is the best approach, but it was sufficient to let me open my mail folder.

Interaction with IMAP server illustrating problem:
* OK kitche1.zk3.dec.com Cyrus IMAP4 v1.6.19 server ready
a0000 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS
X-NON-HIERARCHICAL-RENAME NO_ATOMIC_RENAME AUTH=PLAIN UNSELECT
a0000 OK Completed
a0001 LOGIN "username" "password"
a0001 OK User logged in
a0002 SELECT "INBOX.Backup"
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)]
* 72777 EXISTS
* 7 RECENT
* OK [UNSEEN 31012]
* OK [UIDVALIDITY 1037659487]
* OK [UIDNEXT 72780]
a0002 OK [READ-WRITE] Completed
a0003 FETCH 3274 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS
(DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO
REPLY-TO LINES X-LABEL)])
* OK Message 3274 no longer exists
* 3274 FETCH (FLAGS (\Seen) UID 3276 INTERNALDATE " 4-May-2000 07:43:02
-0400" RFC822.SIZE 15262 BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC
MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO REPLY-TO LINES X-LABEL)] "")
a0003 OK Completed
a0004 FETCH 3275 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS
(DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO
REPLY-TO LINES X-LABEL)])
* OK Message 3275 no longer exists
* 3275 FETCH (FLAGS (\Seen) UID 3277 INTERNALDATE " 4-May-2000 07:55:30
-0400" RFC822.SIZE 15264 BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC
MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO REPLY-TO LINES X-LABEL)] "")
a0004 OK Completed
a0005 FETCH 3276 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS
(DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO
REPLY-TO LINES X-LABEL)])
* 3276 FETCH (FLAGS (\Seen) UID 3278 INTERNALDATE " 4-May-2000 09:34:23
-0400" RFC822.SIZE 1715 BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC
MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO REPLY-TO LINES X-LABEL)] {270}
From: "Chris Walker" <cwalker@xxxxxxxxxxx>
To: <usg_zk@xxxxxxxxxxx>
Subject: ! PC Virus Alert ! VBS.LoveLetter.A
Date: Thu, 4 May 2000 09:31:40 -0400
Message-ID: <JFEAJBIHLMALDNHBADCLIEHECCAA.cwalker@xxxxxxxxxxx>
Content-Type: text/plain;
   charset="iso-8859-1"

)
a0005 OK Completed
a0006 LOGOUT
* BYE LOGOUT received
a0006 OK Completed
Connection closed by foreign host.



patch-1.5.5.1.rjb.nolitcount.1:
diff -rup mutt-1.5.5.1/imap/message.c /tmp/mutt-patched/imap/message.c
--- mutt-1.5.5.1/imap/message.c 2003-11-05 04:41:36.000000000 -0500
+++ /tmp/mutt-patched/imap/message.c    2004-01-20 12:59:09.000000000 -0500
@@ -768,11 +768,13 @@ static int msg_fetch_header (CONTEXT* ct
    * (eg Domino puts FLAGS here). Nothing wrong with that, either.
    * This all has to go - we should accept literals and nonliterals   
    * interchangeably at any time. */
-  if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE)
-    return -2;
-
-  if (msg_parse_fetch (h, idata->cmd.buf) == -1)
-    return rc;   
+  if (bytes)
+  {
+    if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE)
+      return rc;
+    if (msg_parse_fetch (h, idata->cmd.buf) == -1)
+      return rc;
+  }

   rc = 0; /* success */

diff -rup mutt-1.5.5.1/imap/util.c /tmp/mutt-patched/imap/util.c
--- mutt-1.5.5.1/imap/util.c    2003-11-05 04:41:36.000000000 -0500
+++ /tmp/mutt-patched/imap/util.c       2004-01-20 13:01:26.000000000 -0500
@@ -307,7 +307,17 @@ int imap_get_literal_count(const char *b
   char *pn;

   if (!(pc = strchr (buf, '{')))
-    return (-1);
+  {
+    if ((pc = strrchr (buf, '"')) && pc > (char *)buf && pc[-1] == '"')
+    {
+      *bytes = 0;
+      return (0);
+    }
+    else
+    {
+      return (-1);
+    }
+  }
   pc++;
   pn = pc;
   while (isdigit ((unsigned char) *pc))


-- System Information
System Version: Linux grail 2.4.22-gentoo-r4 #1 Fri Jan 9 11:05:46 EST 2004 
i686 Intel(R) Pentium(R) 4 CPU 1500MHz GenuineIntel GNU/Linux

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
gcc
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs
Configured with: /var/tmp/portage/gcc-3.2.3-r3/work/gcc-3.2.3/configure 
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.2 
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include 
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2 
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man 
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info --enable-shared 
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib 
--enable-languages=c,c++,f77,objc,java --enable-threads=posix 
--enable-long-long --disable-checking --enable-cstdio=stdio 
--enable-clocale=generic --enable-__cxa_atexit 
--enable-version-specific-runtime-libs 
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3 
--with-local-prefix=/usr/local --enable-shared --enable-nls 
--without-included-gettext
Thread model: posix
gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)

- CFLAGS
-Wall -pedantic -Wall -pedantic -O3 -mcpu=pentium4 -funroll-loops 
-fomit-frame-pointer -pipe

-- Mutt Version Information

Mutt 1.5.4i (2003-03-19)
Copyright (C) 1996-2002 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.4.22-gentoo-r4 (i686) [using ncurses 5.3]
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
-USE_FCNTL  +USE_FLOCK
+USE_POP  +USE_IMAP  +IMAP_EDIT_THREADS  -USE_GSS  +USE_SSL  -USE_SASL  
-USE_SASL2  
-HAVE_REGCOMP  +USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  
-BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET 
 +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  -HAVE_LIBIDN  +HAVE_GETSID  +HAVE_GETADDRINFO  
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc/mutt"
EXECSHELL="/bin/sh"
-MIXMASTER
To contact the developers, please mail to <mutt-dev@xxxxxxxx>.
To report a bug, please use the flea(1) utility.

patch-1.5.4.rr.compressed.1
patch-1.5.3.cd.edit_threads.9.5

--- Begin /home/bbell/.muttrc
reset all
unhook *
source ~/.muttrc.common
set spoolfile='=inbox'
source ~/.muttrc.hooks
mailboxes ! \
  =hpux \
  =tru64 \
  =prufrock \
  =gnome \
  =gnome-devel \
  =clinux \
  =gnhlug \
  =pear \
  =rdesktop \
  =mutt-dev \
  =mutt-user \
  =muttzilla \
  =mysql #\
  =dsl \
  =archived \
  =gnhlug_archive \
  =saved \
  =sent \
  =trash
--- End /home/bbell/.muttrc


--- Begin /etc/mutt/Muttrc
ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines
macro index \eb '/~b ' 'search in message bodies'
macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'
macro generic <f1> "!less /usr/share/doc/mutt-1.5.4-r1/manual.txt\n" "Show Mutt 
documentation"
macro index   <f1> "!less /usr/share/doc/mutt-1.5.4-r1/manual.txt\n" "Show Mutt 
documentation"
macro pager   <f1> "!less /usr/share/doc/mutt-1.5.4-r1/manual.txt\n" "Show Mutt 
documentation"
--- End /etc/mutt/Muttrc

---------------------------------------
Received: (at 1795-done) by bugs.guug.de; 13 Apr 2004 15:11:26 +0000
>From roessler+bounce@xxxxxxxxxxxxxxxxxx Tue Apr 13 17:11:12 2004
Received: from does-not-exist.info ([217.160.221.198] 
helo=kamino.does-not-exist.org)
        by trithemius.gnupg.org with esmtp (Exim 3.35 #1 (Debian))
        id 1BDPZ9-0004EL-00
        for <1795-done@xxxxxxxxxxxx>; Tue, 13 Apr 2004 17:11:11 +0200
Received: from raktajino.does-not-exist.org (schroedinger.iam.uni-bonn.de 
[131.220.223.204])
        (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
        (No client certificate requested)
        by kamino.does-not-exist.org (Postfix) with ESMTP
        id 6F6C9193366; Tue, 13 Apr 2004 17:14:08 +0200 (CEST)
Received: by raktajino.does-not-exist.org (Postfix, from userid 500)
        id 900D084AB4; Tue, 13 Apr 2004 17:13:24 +0200 (CEST)
Date: Tue, 13 Apr 2004 17:13:23 +0200
From: Thomas Roessler <roessler@xxxxxxxxxxxxxxxxxx>
To: Bob Bell <bbell@xxxxxxxxxxxxxxxxxxxxx>, 1795-done@xxxxxxxxxxxx
Cc: Brendan Cully <brendan@xxxxxxxxxx>
Subject: Re: bug#1795: mutt-1.5.4i: Failure to open Cyrus IMAP mailbox
Message-ID: <20040413151323.GH3813@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20040204155620.GF9397@xxxxxxxxxxx> 
<20040405214930.GA5612@xxxxxxxxxxx> <20040412231956.GA7820@xxxxxxxxxxxxxx> 
<20040413145820.GM4032@xxxxxxxxxxx>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
        protocol="application/pgp-signature"; boundary="RhUH2Ysw6aD5utA4"
Content-Disposition: inline
In-Reply-To: <20040413145820.GM4032@xxxxxxxxxxx>
User-Agent: Mutt/1.5.6i
X-Spam-Status: No, hits=-109.2 required=4.0
        tests=AWL,BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2,
              QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES,
              USER_AGENT_MUTT,USER_IN_WHITELIST
        autolearn=ham version=2.55
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)


--RhUH2Ysw6aD5utA4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2004-04-13 10:58:20 -0400, Bob Bell wrote:

> Yes, your patch did work.  Thanks a lot for it.  I hope to see it in
> 1.5.7!

It's in the CVS now.

--=20
Thomas Roessler                       <roessler@xxxxxxxxxxxxxxxxxx>

--RhUH2Ysw6aD5utA4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAfAOTA+zWmZc3wN0RAjZUAJ9usWe0oZnEHQr8yYdbKD8vQdSecACghJmP
y4l2z3xKoyRg0nBvz3l60Ow=
=FOBr
-----END PGP SIGNATURE-----

--RhUH2Ysw6aD5utA4--