To reproduce:
tab-title-account={{.Account}}{{if .Recent}} ({{.Recent}}){{end}}
sendmail
or similar) and give it enough time to arrive.Conversely, although it's probably not related directly, the status isn't cleared when the new messages are read (or marked as read) and one has to change folder (another folder of the same account, not just different account/tab) to clear it. ~inwit reports to be seeing the same thing for {{.Unread}} (if I understood and remember correctly) -- I only have the unread count displayed in the folder list (so the defaults), rather than the tab title, and there it changes immediately and correctly for me when I read or unread a message.
If I understand the ticket properly, https://lists.sr.ht/~rjarry/aerc-devel/patches/58306 is likely to address the Unread part.
I don't think it addresses the Recent case, that has different semantics according to https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.2: one session and only one will see it, and it will clear if the session drops for any reason (or aerc is closed/reopened).
Ah, you are right, the RFC says that "This flag can not be altered by the client.", so it seems that it is OK that the
.Recent
count can only go up as far as IMAP is concerned. Basically what I had in mind was that aerc should only consider as "recent" messages that have the \Recent flag set and not the \Seen flag, but that probably doesn't make sense then.As for the startup, I still see the recent flags get cleared. My suspicion is that aerc is actually opening the mailbox more than once during startup (i. e. there is some "session drop" as you write).