#3771: Spurious "New mail" with IMAP
--------------------+---------------------
Reporter: bacam | Owner: brendan
Type: defect | Status: new
Priority: minor | Milestone:
Component: IMAP | Version:
Keywords: |
--------------------+---------------------
I'm storing mail on a dovecot IMAP server, and if I receive a message in
the INBOX, delete it, and restart mutt, then every time I change out of
the INBOX I get a "New mail in imap://..." message. Running `mutt -d 3`,
I see that it's always receiving the correct UIDNEXT from the server, but
there's a lower value in the buffy list.
The only code I could find that changes the stored uidnext value is in
`imap/message.c` in `imap_read_headers`:
{{{
if (maxuid && (status = imap_mboxcache_get (idata, idata->mailbox, 0)))
status->uidnext = maxuid + 1;
}}}
I'm not sure what this code was originally intended for; perhaps a server
that returns bogus UIDNEXT values? In any case, if I remove it or add the
extra condition `&& status->uidnext <= maxuid` then the bogus message
disappears and looking at the debug log shows that the buffy list has the
correct value.
--
Ticket URL: <http://dev.mutt.org/trac/ticket/3771>
Mutt <http://www.mutt.org/>
The Mutt mail user agent