When messages marked \Recent are deleted and expunged, the patch now sends the new message count and the new recent messages count (although the message count is not really necessary).
From RFC 3501 errata (ftp://ftp.cac.washington.edu/imap/rfc3501-errata)
<< Section 6.4.3, page 49: old: The EXPUNGE command permanently removes all messages that have the \Deleted flag set from the currently selected mailbox. Before returning an OK to the client, an untagged EXPUNGE response is sent for each message that is removed. new: The EXPUNGE command permanently removes all messages that have the \Deleted flag set from the currently selected mailbox. Before returning an OK to the client, an untagged EXPUNGE response is sent for each message that is removed. Note that if any messages with the \Recent flag set are expunged, an untagged RECENT response is sent after the untagged EXPUNGE(s) to update the client's count of RECENT messages.
The bug is that when we connect to the IMAP server through a command (ssh /usr/libexec/imap for example). \Recent flags are not removed when we have finish the access to the mailbox. (I have not yet investigated about that)
Besides that, did you found a solution for the message parser ? (the bug in FETCH ENVELOPE that I noticed personnaly to Timo)
-- DINH V. Hoa,
"s/^\(\(\\.\|[^\[]\|\[\(\^.\|[^^]\)[^]]*\]\)*\)\(\\[^\*[]\)/\1\\\4/" -- Stéphane CHAZELAS