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

Re: IMAP, mark_old and new mail



On Tue, Oct 31, 2006 at 09:08:08AM -0800, Brendan Cully wrote:
On Tuesday, 31 October 2006 at 10:35, Bob Bell wrote:
> It's my understand that "ON" should be reflecting the cache UIDNEXT
> value.  That is, it should be 2187, but it is never set.  Therefore,
> mutt always thinks the folder has new mail.

Actually ON isn't cached until the mailbox is open. Otherwise when you
started mutt, it would tell you there was new mail in mailbox FOO,
then forget about it the next time it polled. ON should reflect the
value of UIDNEXT from the last time you opened the mailbox.

The partial debug output I provided was actually the result of being in
INBOX.Bob.MyPrivateFolder, switching to INBOX.Bob.MyOtherFolder, being
told there was new mail in INBOX.Bob.MyPrivateFolder and switching to
INBOX.Bob.MyPrivateFolder, going back to INBOX.Bob.MyOtherFolder, and
then again told there was new mail in INBOX.Bob.MyPrivateFolder and
switching to INBOX.Bob.MyPrivateFolder.  (Folder names have obviously
been changed)

That of course wasn't clear since I didn't mention it and only provided
a small part of the debug.  I apologize if that caused confusion.  But
I *did* open the mailbox several times.

Are you expecting to see a "OK [UIDNEXT" reply to a "SELECT"?  There's
code in imap.c that's at least handling it, but my IMAP server isn't
saying it.  Here's a very brief conversation with my IMAP server
(provided to illustrate what Courier says in response to SELECT):

$ telnet 192.168.1.1 143
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT 
THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS 
XCOURIEROUTBOX=INBOX.Outbox XMAGICTRASH] Courier-IMAP ready. Copyright 
1998-2005 Double Precision, Inc.  See COPYING for distribution information.
a0000 LOGIN "imapuser" "secretpassword"
a0000 OK LOGIN Ok.
a0001 SELECT "INBOX.Bob.MyPrivateFolder"
* FLAGS (NonJunk Old \Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (NonJunk Old \* \Draft \Answered \Flagged \Deleted \Seen)] 
Limited
* 107 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1030314270] Ok
* OK [MYRIGHTS "acdilrsw"] ACL
a0001 OK [READ-WRITE] Ok
a0002 LOGOUT
* BYE Courier-IMAP server shutting down
a0002 OK LOGOUT completed
Connection closed by foreign host.

Hope this helps,
   Bob