The attached patch cleans up some bugs in switching IMAP mailboxes:
* free current flags on mailbox close * reset reopen state * don't parse the same untagged SELECT response for multiple options * call mx_update_context after reading the whole mailbox, not after each message * reset new mail flag if mail arrives in the middle of opening the mailbox. This should close 1139 939 is most likely unaffected. I discovered these problems while investigating 939.
Showing with 20 additions and 21 deletions