'parse the email FLAGS response'

def get_email_seen_status(self, uid, flag_string):

    if (not flag_string):
        return None
    flags = []
    for flag in (imaplib.ParseFlags(flag_string) or []):
        pattern = re.compile(u'\\w+')
        match = re.search(pattern, flag)
        flags.append(match.group(0))
    if (u'Seen' in flags):
        self.seen_status.update({uid: u'SEEN'})
    else:
        self.seen_status.update({uid: u'UNSEEN'})
