IMAP Problem: Messages "disappear"
Michael Østergaard Pedersen
mop@itplus.dk
Wed, 23 Jan 2002 01:43:41 +0100
There seems to be a problem in IMP 3.0 (or some other component) with messages "disappearing" when using IMAP.
When I receive a new message and logs on, I can see the message in the Inbox. If I click the message I get an error telling me that it could not retrieve the message. Now I'm back at my Inbox again, but the message is no longer there. I have dumped the communication between PHP and IMAP (in my case Courier-IMAP) and here is what I have found out:
The first time I read my Inbox I only see the new message (and not any old ones that were already there). This looks like this:
------------------------------------
S: * OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for distribution information.
C: 00000000 CAPABILITY
S. * CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT
00000000 OK CAPABILITY completed
C: 00000001 LOGIN username password
S: 00000001 OK LOGIN Ok.
C: 00000002 CAPABILITY
* CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT
S: 00000002 OK CAPABILITY completed
C: 00000003 SELECT INBOX
S: * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 2 EXISTS
C: * 00000004 LIST "" INBOX.*
S: * LIST (\HasNoChildren) "." "INBOX.Drafts"
* LIST (\HasNoChildren) "." "INBOX.Sent Items"
* LIST (\HasNoChildren) "." "INBOX.Trash"
00000004 OK L
C: 00000005 LIST "" ""
S: * LIST (\Noselect) "." ""
00000005 OK LIST completed
C: 00000006 NOOP
S: 00000006 OK NOOP completed
C: 00000007 UID SORT (ARRIVAL) US-ASCII ALL
S. * SORT 4 6
00000007 OK SORT done.
C: 00000008 UID FETCH 4 UID
S: * 1 FETCH (UID 4)
00000008 OK FETCH completed.
C: 00000009 FETCH 1,2 (ENVELOPE BODY.PEEK[HEADER.FIELDS (Path Message-ID Newsgroups Followup-To References)] INTERNALDATE RFC822.SIZE FLAGS)
S: * 1 FETCH (ENVELOPE ("Thu, 17 Jan 2002 17:30:28 +0100" "ADSL forbindelse hos IT+" (("Hans Guldager Knudsen" NIL "hgk" "itplus.dk")) (("Hans Guldager
C: 0000000a LOGOUT
S: * BYE Courier-IMAP server shutting down
0000000a OK LOGOUT completed
------------------------------------
As you can see, the client only asks for one message even though there are two messages in the Inbox.
The following occurs when I try to read the message from my Inbox:
------------------------------------
S: * OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for distribution information.
C: 00000000 CAPABILITY
S: * CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT
00000000 OK CAPABILITY completed
C: 00000001 LOGIN username password
S: 00000001 OK LOGIN Ok.
C: 00000002 CAPABILITY
S: * CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT
00000002 OK CAPABILITY completed
C: 00000003 SELECT INBOX
S: * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 2 EXISTS
C: * 00000004 UID SORT (ARRIVAL) US-ASCII ALL
S: * SORT 4 6
00000004 OK SORT done.
C: 00000005 LIST "" INBOX.*
S: * LIST (\HasNoChildren) "." "INBOX.Drafts"
* LIST (\HasNoChildren) "." "INBOX.Sent Items"
* LIST (\HasNoChildren) "." "INBOX.Trash"
00000005 OK L
C: 00000006 LIST "" ""
S: * LIST (\Noselect) "." ""
00000006 OK LIST completed
C: 00000007 UID FETCH 4 UID
S: * 1 FETCH (UID 4)
00000007 OK FETCH completed.
C: 00000008 LOGOUT
S: * BYE Courier-IMAP server shutting down
00000008 OK LOGOUT completed
------------------------------------
After the client sends a FETCH command and the server says ok, the client never asks for the message. No wonder I can't read that message.
And finally after returning to the Inbox:
------------------------------------
S: * OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for distribution information.
C: 00000000 CAPABILITY
S: * CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT
00000000 OK CAPABILITY completed
C: 00000001 LOGIN username password
S: 00000001 OK LOGIN Ok.
C: 00000002 CAPABILITY
S: * CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT
00000002 OK CAPABILITY completed
C: 00000003 SELECT INBOX
S. * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 2 EXISTS
C: * 00000004 LIST "" INBOX.*
S: * LIST (\HasNoChildren) "." "INBOX.Drafts"
* LIST (\HasNoChildren) "." "INBOX.Sent Items"
* LIST (\HasNoChildren) "." "INBOX.Trash"
00000004 OK L
C: 00000005 LIST "" ""
S: * LIST (\Noselect) "." ""
00000005 OK LIST completed
C: 00000006 NOOP
S: 00000006 OK NOOP completed
C: 00000007 LOGOUT
S: * BYE Courier-IMAP server shutting down
00000007 OK LOGOUT completed
------------------------------------
The server says that there are two messages in the Inbox, but the client never asks for any of them, so my Inbox comes up empty even though there are still two messages in it.