'Rename a mailbox
This command is allowed in the Authenticated and Selected states.
@type oldname: L{str}
@param oldname: The current name of the mailbox to rename.
@type newname: L{str}
@param newname: The new name to give the mailbox.
@rtype: C{Deferred}
@return: A deferred whose callback is invoked if the rename is
successful and whose errback is invoked otherwise.'

def rename(self, oldname, newname):

    oldname = _prepareMailboxName(oldname)
    newname = _prepareMailboxName(newname)
    return self.sendCommand(Command('RENAME', '    '.join((oldname, newname))))
