'Search mailbox for matching messages.
(typ, [data]) = <instance>.search(charset, criterion, ...)
\'data\' is space separated list of matching message numbers.'

def search(self, charset, *criteria):

    name = 'SEARCH'
    if charset:
        (typ, dat) = self._simple_command(name, 'CHARSET', charset, *criteria)
    else:
        (typ, dat) = self._simple_command(name, *criteria)
    return self._untagged_response(typ, dat, name)
