imapserver should track read-only state of the selected mailbox and disallow calling STORE, EXPUNGE, APPEND on it. Additionally, EXPUNGE should not be called when unselecting a read-only mailbox - currently it is impossible to tell whether EXPUNGE is called via unselect or by client (incorrectly) to return a correct error.