def parseFilterStr(args):
    """Convert Message-Filter settings in '+<addr> -<addr> ...' format to a dict of the form
    { '<addr>':True, '<addr>':False, ... } 
    Returns a list: ['<prefix>', filters]
    """
    out = {}
    if type(args) in str:
        args = [args]
    prefix = None
    for arg in args:
        head = None
        for plus in arg.split('+'):
            minus = plus.split('-')
            plusfs = minus.pop(0).strip()
            if len(plusfs):
                plusfs = '/' + plusfs.strip('/')
            if head == None and plusfs != '/*':
                head = plusfs
            elif len(plusfs):
                if plusfs == '/*':
                    out = {'/*': True}
                else:
                    out[plusfs] = True
            for minusfs in minus:
                minusfs = minusfs.strip()
                if len(minusfs):
                    minusfs = '/' + minusfs.strip('/')
                    if minusfs == '/*':
                        out = {'/*': False}
                    else:
                        out[minusfs] = False
        if prefix == None:
            prefix = head
    return [prefix, out]
