Hello,

I'm trying to use mutt (1.5.21 on OpenBSD 4.9) to connect to an IMAP
server.  Connection and authentication work fine but then something
goes wrong while fetching message headers: I get a "skipping FETCH
response for unknown message number" error for every message and then
mutt gets stuck and I have to kill it.  Here's the log:

[...]
[2011-10-24 20:21:56] SSL connection using TLSv1/SSLv3 (ECDHE-RSA-AES256-SHA)
[2011-10-24 20:21:57] Connected to some.imap.server.some.where:993 on fd=4
[2011-10-24 20:21:57] 4< * OK localhost CrediMail imapserver-2.5 ready.
[2011-10-24 20:21:57] 4> a0000 CAPABILITY
[2011-10-24 20:21:57] 4< * CAPABILITY IMAP4 IMAP4rev1
[2011-10-24 20:21:57] 4< a0000 OK CAPABILITY COMPLETED.
[2011-10-24 20:21:57] imap_authenticate: Using any available method.
[2011-10-24 20:22:00] Logging in...
[2011-10-24 20:22:00] Sending LOGIN command for meunier...
[2011-10-24 20:22:00] 4< a0001 OK LOGIN COMPLETED.
[2011-10-24 20:22:00] Communication encrypted at 256 bits
[2011-10-24 20:22:00] 4> a0002 CAPABILITY
a0003 LIST "" ""
[2011-10-24 20:22:00] 4< * CAPABILITY IMAP4 IMAP4rev1
[2011-10-24 20:22:00] 4< a0002 OK CAPABILITY COMPLETED.
[2011-10-24 20:22:00] 4< * LIST (\NoInferiors \HasNoChildren) "/" "Archives"
[2011-10-24 20:22:00] 4< * LIST (\NoInferiors \HasNoChildren) "/" "Drafts"
[2011-10-24 20:22:00] 4< * LIST (\NoInferiors \HasNoChildren) "/" "INBOX"
[2011-10-24 20:22:00] 4< * LIST (\NoInferiors \HasNoChildren) "/" "Sent 
Messages"
[2011-10-24 20:22:00] 4< * LIST (\NoInferiors \HasNoChildren) "/" 
"&wqTTOLpUx3zVaA-"
[2011-10-24 20:22:00] 4< * LIST (\NoInferiors \HasNoChildren) "/" "Deleted 
Messages"
[2011-10-24 20:22:00] 4< a0003 OK LIST COMPLETED
[2011-10-24 20:22:00] Selecting INBOX...
[2011-10-24 20:22:00] 4> a0004 SELECT "INBOX"
[2011-10-24 20:22:00] 4< * 12 EXISTS
[2011-10-24 20:22:00] Handling EXISTS
[2011-10-24 20:22:00] cmd_handle_untagged: New mail in INBOX - 12 messages 
total.
[2011-10-24 20:22:00] 4< * 3 RECENT
[2011-10-24 20:22:00] 4< * OK [UNSEEN 100028] Message 100028 is first unseen.
[2011-10-24 20:22:00] 4< * OK [UIDVALIDITY 1319410466] UID validity status
[2011-10-24 20:22:00] 4< * OK [UIDNEXT 100028] UIDNEXT
[2011-10-24 20:22:00] 4< * FLAGS (\Deleted \Seen \Recent \Flagged \Draft 
\Recent)
[2011-10-24 20:22:00] 4< * OK [PERMANENTFLAGS (\Deleted \Seen \*)] 
PermanentFlags
[2011-10-24 20:22:00] 4< a0004 OK [READ-WRITE] SELECT COMPLETED
[2011-10-24 20:22:00] Fetching message headers... (12)
[2011-10-24 20:22:00] 4> a0005 FETCH 1:12 (UID FLAGS INTERNALDATE RFC822.SIZE 
BODY.PEEK[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES 
CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)])
[2011-10-24 20:22:01] 4< * 100027 FETCH (UID 100027 FLAGS (\Recent \Seen) 
INTERNALDATE "24-Oct-2011 16:23:00 +0900" RFC822.SIZE 39753 BODY[HEADER.FIELDS 
(DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION 
IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)] {312}
[2011-10-24 20:22:01] imap_read_literal: reading 312 bytes
[2011-10-24 20:22:01] 4< )
[2011-10-24 20:22:01] imap_read_headers: skipping FETCH response for unknown 
message number 100027
[2011-10-24 20:22:01] 4< * 100023 FETCH (UID 100023 FLAGS (\Recent \Seen) 
INTERNALDATE "24-Oct-2011 11:15:00 +0900" RFC822.SIZE 575722 BODY[HEADER.FIELDS 
(DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION 
IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)] {348}
[2011-10-24 20:22:01] imap_read_literal: reading 348 bytes
[2011-10-24 20:22:01] 4< )
[2011-10-24 20:22:01] imap_read_headers: skipping FETCH response for unknown 
message number 100023
[... and so on for every message ...]
[2011-10-24 20:22:01] 4< * 100002 FETCH (UID 100002 FLAGS (\Seen) INTERNALDATE 
"26-Jul-2011 11:31:00 +0900" RFC822.SIZE 107354 BODY[HEADER.FIELDS (DATE FROM 
SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION 
IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)] {393}
[2011-10-24 20:22:01] imap_read_literal: reading 393 bytes
[2011-10-24 20:22:01] 4< )
[2011-10-24 20:22:01] imap_read_headers: skipping FETCH response for unknown 
message number 100002
[2011-10-24 20:22:01] 4< * 100001 FETCH (UID 100001 FLAGS (\Seen) INTERNALDATE 
"01-Jul-2011 09:50:00 +0900" RFC822.SIZE 26958 BODY[HEADER.FIELDS (DATE FROM 
SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION 
IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)] {357}
[2011-10-24 20:22:01] imap_read_literal: reading 357 bytes
[2011-10-24 20:22:01] 4< )
[2011-10-24 20:22:01] imap_read_headers: skipping FETCH response for unknown 
message number 100001
[2011-10-24 20:22:01] 4< a0005 OK  FETCH COMPLETED.

At that point mutt gets stuck and the log ends.

So... anyone has any idea how I might get this to work?
Please note: I have no control over the IMAP server.

For reference, here's the log from thunderbird, which works fine:

-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:NA:CreateNewLineFromSocket: * OK localhost 
CrediMail imapserver-2.5 ready.
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:NA:SendData: 1 
capability
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=30 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:NA:CreateNewLineFromSocket: * CAPABILITY 
IMAP4 IMAP4rev1
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=28 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:NA:CreateNewLineFromSocket: 1 OK 
CAPABILITY COMPLETED.
-2056607744[8807fe00]: try to log in
-2056607744[8807fe00]: IMAP auth: server caps 0x35, pref 0x1006, failed 0x0, 
avail caps 0x4
-2056607744[8807fe00]: (GSSAPI = 0x1000000, CRAM = 0x20000, NTLM = 0x100000, 
MSN =  0x200000, PLAIN = 0x1000, LOGIN = 0x2, old-style IMAP login = 0x4)
-2056607744[8807fe00]: trying auth method 0x4
-2056607744[8807fe00]: got new password
-2056607744[8807fe00]: IMAP: trying auth method 0x4
-2056607744[8807fe00]: old-style auth
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:NA:SendData: 
Logging suppressed for this command (it probably contained authentication 
information)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=23 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:NA:CreateNewLineFromSocket: 3 OK LOGIN 
COMPLETED.
-2056607744[8807fe00]: login succeeded
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:A:SendData: 4 list 
"" "%"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=53 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "Archives"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=51 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "Drafts"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=50 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "INBOX"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=58 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "Sent Messages"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=61 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "&wqTTOLpUx3zVaA-"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=61 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "Deleted Messages"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=21 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: 4 OK LIST 
COMPLETED
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:A:SendData: 5 list 
"" "%/%"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=21 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: 5 OK LIST 
COMPLETED
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:A:SendData: 6 list 
"" "Shared Folders/User/%"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=21 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: 6 OK LIST 
COMPLETED
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:A:SendData: 7 list 
"" "Shared Folders/User/%/%"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=21 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: 7 OK LIST 
COMPLETED
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:A:SendData: 8 list 
"" "INBOX"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=50 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * LIST 
(\NoInferiors \HasNoChildren) "/" "INBOX"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=21 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: 8 OK LIST 
COMPLETED
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:A:SendData: 9 
select "INBOX"
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=13 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * 12 EXISTS
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=12 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * 3 RECENT
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * OK [UNSEEN 
100028] Message 100028 is first unseen.
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=51 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * OK 
[UIDVALIDITY 1319410466] UID validity status
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=31 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * OK [UIDNEXT 
100028] UIDNEXT
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=58 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * FLAGS 
(\Deleted \Seen \Recent \Flagged \Draft \Recent)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=58 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: * OK 
[PERMANENTFLAGS (\Deleted \Seen \*)] PermanentFlags
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=36 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:A:CreateNewLineFromSocket: 9 OK 
[READ-WRITE] SELECT COMPLETED
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:S-INBOX:SendData: 
10 UID fetch 1:* (FLAGS)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100001 
FETCH (UID 100001 FLAGS (\Seen) UID 100001)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100002 
FETCH (UID 100002 FLAGS (\Seen) UID 100002)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100003 
FETCH (UID 100003 FLAGS (\Seen) UID 100003)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100004 
FETCH (UID 100004 FLAGS (\Seen) UID 100004)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100005 
FETCH (UID 100005 FLAGS (\Seen) UID 100005)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100006 
FETCH (UID 100006 FLAGS (\Seen) UID 100006)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100007 
FETCH (UID 100007 FLAGS (\Seen) UID 100007)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100008 
FETCH (UID 100008 FLAGS (\Seen) UID 100008)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=54 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100011 
FETCH (UID 100011 FLAGS (\Seen) UID 100011)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=62 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100022 
FETCH (UID 100022 FLAGS (\Recent \Seen) UID 100022)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=62 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100023 
FETCH (UID 100023 FLAGS (\Recent \Seen) UID 100023)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=62 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100027 
FETCH (UID 100027 FLAGS (\Recent \Seen) UID 100027)
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=28 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: 10 OK UID 
FETCH COMPLETED.
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:S-INBOX:SendData: 
11 UID fetch 100027 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc 
Bcc Subject Date Message-ID Priority X-Priority References Newsgroups 
In-Reply-To Content-Type)])
-2056607744[8807fe00]: ReadNextLine [stream=8320a208 nb=213 needmore=0]
-2056607744[8807fe00]: 
8600c000:some.imap.server.some.where:S-INBOX:CreateNewLineFromSocket: * 100027 
FETCH (UID 100027 UID 100027 RFC822.SIZE 39753 FLAGS (\Recent \Seen) 
BODY[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority 
References Newsgroups In-Reply-To Content-Type)] {327}
-2056607744[8807fe00]: 8600c000:some.imap.server.some.where:S-INBOX:STREAM:OPEN 
Size: 39753: Begin Message Download Stream
[... etc, everything works ...]

Thanks for any help,

Philippe


Reply via email to