Description
When SELECT a mailbox we first retrieve all needed data from the mailbox and then add the listeners which are responsible to handle updates on the mailbox. The problem is that that we may miss some event as the add of the listeners may take some time. The correct way would be to add the listeners first and then handle the rest (ignore events for duplicate uids then).