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

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



Your message dated Wed, 4 Feb 2004 11:16:54 -0500
with message-id <20040204161654.GG9397@xxxxxxxxxxx>
and subject line bug#1794: 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:41:02 +0000
>From bbell@xxxxxx Wed Feb 04 16:41:00 2004
Received: from zcamail03.zca.compaq.com ([161.114.32.103])
        by trithemius.gnupg.org with esmtp (Exim 3.35 #1 (Debian))
        id 1AoP99-0002HF-00
        for <submit@xxxxxxxxxxxx>; Wed, 04 Feb 2004 16:41:00 +0100
Received: from taynzmail03.nz-tay.cpqcorp.net (taynzmail03.nz-tay.cpqcorp.net 
[16.47.4.103])
        by zcamail03.zca.compaq.com (Postfix) with ESMTP
        id C8FF7BA80; Wed,  4 Feb 2004 07:43:10 -0800 (PST)
Received: from anw.zk3.dec.com (or.zk3.dec.com [16.140.48.4])
        by taynzmail03.nz-tay.cpqcorp.net (Postfix) with ESMTP
        id 54AF62D43; Wed,  4 Feb 2004 10:43:10 -0500 (EST)
Received: from zk3.dec.com by anw.zk3.dec.com (8.11.1/1.1.22.2/08Sep98-0251PM)
        id i14Fh670002125163; Wed, 4 Feb 2004 10:43:10 -0500 (EST)
Message-Id: <200402041543.i14Fh670002125163@xxxxxxxxxxxxxxx>
Received: by zk3.dec.com (sSMTP sendmail emulation); Wed, 4 Feb 2004 10:42:48 
-0500
Date: Wed, 4 Feb 2004 10:42:48 -0500
From: bbell@xxxxxxxxxxxxxxxxxxxxx
Subject: mutt-1.5.4i: Failure to open Cyrus IMAP mailbox
To: submit@xxxxxxxxxxxx
X-Spam-Status: No, hits=-3.0 required=4.0
        tests=AWL,MSG_ID_ADDED_BY_MTA_2,NO_REAL_NAME,UPPERCASE_25_50
        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 1794-done) by bugs.guug.de; 4 Feb 2004 16:14:35 +0000
>From bbell@xxxxxx Wed Feb 04 17:14:31 2004
Received: from zmamail03.zma.compaq.com ([161.114.64.103])
        by trithemius.gnupg.org with esmtp (Exim 3.35 #1 (Debian))
        id 1AoPfb-0002mf-00
        for <1794-done@xxxxxxxxxxxx>; Wed, 04 Feb 2004 17:14:31 +0100
Received: from taynzmail03.nz-tay.cpqcorp.net (taynzmail03.nz-tay.cpqcorp.net 
[16.47.4.103])
        by zmamail03.zma.compaq.com (Postfix) with ESMTP id B6A5D1109D
        for <1794-done@xxxxxxxxxxxx>; Wed,  4 Feb 2004 11:17:13 -0500 (EST)
Received: from anw.zk3.dec.com (alpha.zk3.dec.com [16.140.128.4])
        by taynzmail03.nz-tay.cpqcorp.net (Postfix) with ESMTP id 7F19A2D33
        for <1794-done@xxxxxxxxxxxx>; Wed,  4 Feb 2004 11:17:13 -0500 (EST)
Received: from zk3.dec.com by anw.zk3.dec.com (8.11.1/1.1.22.2/08Sep98-0251PM)
        id i14GHDR0001256245; Wed, 4 Feb 2004 11:17:13 -0500 (EST)
Received: by zk3.dec.com (sSMTP sendmail emulation); Wed, 4 Feb 2004 11:16:54 
-0500
Date: Wed, 4 Feb 2004 11:16:54 -0500
From: Bob Bell <bbell@xxxxxxxxxxxxxxxxxxxxx>
To: 1794-done@xxxxxxxxxxxx
Subject: Re: bug#1794: mutt-1.5.4i: Failure to open Cyrus IMAP mailbox
Message-ID: <20040204161654.GG9397@xxxxxxxxxxx>
References: <200402041543.i14Fh670002125163@xxxxxxxxxxxxxxx>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline
In-Reply-To: <200402041543.i14Fh670002125163@xxxxxxxxxxxxxxx>
X-Editor: Vim http://www.vim.org/
X-URL: http://www.css.tayloru.edu/~bbell/
User-Agent: Mutt/1.5.4i
X-Spam-Status: No, hits=-5.3 required=4.0
        tests=AWL,IN_REP_TO,REFERENCES,USER_AGENT_MUTT
        autolearn=ham version=2.55
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)

This appearred to be rejected by SpamAssassin, so I resubmitted the
request, but it appears it did get through after all.  Closing as
a duplicate of bug #1795.

-- 
Bob Bell <bbell@xxxxxxxxxxxxxxxxxxxxx>