imap_read_headers() updates the idata and imap_status uidnext after
reading through all the new headers.
The idata is updated properly (only if its uidnext is below maxuid+1),
but the imap_status was always being set to maxuid.
This causes a problem with new mail checking if the most recent
messages are deleted. Then the uidnext will be greater than maxuid+1
in the mailbox, and if there are any other unread messages it will
*always* report new mail even if $mail_check_recent is set.
}
}
- if (maxuid && (status = imap_mboxcache_get (idata, idata->mailbox, 0)))
- status->uidnext = maxuid + 1;
+ if (maxuid && (status = imap_mboxcache_get (idata, idata->mailbox, 0)) &&
+ (status->uidnext < maxuid + 1))
+ status->uidnext = maxuid + 1;
#if USE_HCACHE
mutt_hcache_store_raw (idata->hcache, "/UIDVALIDITY", &idata->uid_validity,