'Note that this function does not check against dryrun settings,
so you need to ensure that it is never called in a
dryrun mode.'

def addmessagesflags(self, uidlist, flags):

    for uid in uidlist:
        if self.uidexists(uid):
            self.addmessageflags(uid, flags)
