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

Re: header_cache broken in cvs



On Monday, 13 March 2006 at 16:49, Aron Griffis wrote:
> Aron Griffis wrote:  [Mon Mar 13 2006, 02:48:52PM EST]
> > That is my suspicion too.  I'll follow up with the trace.
> 
> .muttdebug1 = first run, empty cache
> .muttdebug0 = second run, after cache is populated
> 
> There are negligible differences between the two runs:
> 
> +++ .muttdebug0       2006-03-13 16:38:01.000000000 -0500
> @@ -1 +1 @@
> -Mutt 1.5.11 started at Mon Mar 13 16:37:16 2006
> +Mutt 1.5.11 started at Mon Mar 13 16:37:38 2006
> @@ -2753 +2753 @@
> -message.c:102: mutt_mktemp returns "/tmp/mutt-olive-10208-5904-0".
> +message.c:102: mutt_mktemp returns "/tmp/mutt-olive-10208-5923-0".
> 
> Here is the full text of .muttdebug0 (second run), minus a few
> sensitive portions marked with [..snip..]
> 
> Mutt 1.5.11 started at Mon Mar 13 16:37:38 2006
...
> < * OK IMAP4 Ready mailhub.hp.com 0001f7a4
> > a0000 CAPABILITY
> < * CAPABILITY IMAP4 IMAP4REV1 LITERL+ NAMESPACE
...
> > a0003 STATUS "INBOX.postponed" (MESSAGES)
> a0004 SELECT "INBOX"
> < * STATUS "INBOX.postponed" (MESSAGES 0)
> INBOX.postponed (UIDVALIDITY: 0, UIDNEXT: 0) 0 messages, 0 recent, 0 unseen
> Running default STATUS handler
> < a0003 OK STATUS Completed.
> < * FLAGS (Old \Draft \Answered \Flagged \Deleted \Seen \Recent)
> Getting mailbox FLAGS
> < * OK [PERMANENTFLAGS (Old \* \Draft \Answered \Flagged \Deleted \Seen)] 
> Limited
> Getting mailbox PERMANENTFLAGS
> < * 2230 EXISTS
> Handling EXISTS
> cmd_handle_untagged: New mail in INBOX - 2230 messages total.
> < * 0 RECENT
> < * OK [UIDVALIDITY 1106230294] Ok
> Getting mailbox UIDVALIDITY
> < * OK [MYRIGHTS "acdilrsw"] ACL
> < a0004 OK [READ-WRITE] Ok
...
> > a0005 LOGOUT
> < * BYE Courier-IMAP server shutting down

thanks. It appears that your courier IMAP server isn't supplying a
UIDNEXT value on SELECT. This violates RFC 3501 (section 6.3.1), so
I'm not 100% convinced mutt should work around it, but give this patch
a try...
diff -r c9f3af8f7403 imap/message.c
--- a/imap/message.c    Mon Mar 13 12:10:11 2006 -0800
+++ b/imap/message.c    Mon Mar 13 14:17:21 2006 -0800
@@ -323,6 +323,11 @@ int imap_read_headers (IMAP_DATA* idata,
 #if USE_HCACHE
   mutt_hcache_store_raw (hc, "/UIDVALIDITY", &idata->uid_validity,
                          sizeof (idata->uid_validity), imap_hcache_keylen);
+  if (idata->uidnext < maxuid + 1)
+  {
+    dprint (2, (debugfile, "Overriding UIDNEXT: %u -> %u", idata->uidnext, 
maxuid + 1));
+    idata->uidnext = maxuid + 1;
+  }
   mutt_hcache_store_raw (hc, "/UIDNEXT", &idata->uidnext,
                        sizeof (idata->uidnext), imap_hcache_keylen);
   mutt_hcache_close (hc);