Expunge requires exclusive acquisition of the access lock. Should this be achieved, opens are blocked until the expunge finishes.
Otherwise, the expunged messages are marked with an internal flag (not
visible to the client) that the message is to be expunged. Such messages
become "ghost" messages, as described in RFC 2180 4.1.1 (which as far as I
am concerned is the only correct implementation).
What if the mailbox is all the time opened by other clients, are the messages ever really expunged? That's why I'd rather not have any kind of shared locks blocking exclusive locking. When there's a _lot_ of clients constantly reading the mailbox and keeping shared locks, there's little time to for getting exclusive locks.
