'Select a mailbox
This command is allowed in the Authenticated and Selected states.
@type mailbox: L{str}
@param mailbox: The name of the mailbox to select
@rtype: C{Deferred}
@return: A deferred whose callback is invoked with mailbox
information if the select is successful and whose errback is
invoked otherwise.  Mailbox information consists of a dictionary
with the following keys and values::
FLAGS: A list of strings containing the flags settable on
messages in this mailbox.
EXISTS: An integer indicating the number of messages in this
mailbox.
RECENT: An integer indicating the number of "recent"
messages in this mailbox.
UNSEEN: The message sequence number (an integer) of the
first unseen message in the mailbox.
PERMANENTFLAGS: A list of strings containing the flags that
can be permanently set on messages in this mailbox.
UIDVALIDITY: An integer uniquely identifying this mailbox.'

def select(self, mailbox):

    cmd = 'SELECT'
    args = _prepareMailboxName(mailbox)
    resp = ('FLAGS', 'EXISTS', 'RECENT', 'UNSEEN', 'PERMANENTFLAGS', 'UIDVALIDITY')
    d = self.sendCommand(Command(cmd, args, wantResponse=resp))
    d.addCallback(self.__cbSelect, 1)
    return d
