def append(self, mailbox, flags, struct_time, message):
        """
            result, data = self.connection.append(mailbox, flags, struct_time, message)
            if result == "OK":
                uid = int(re.findall("\d+", str(data))[-1])
        """
        last = self.spam[mailbox][-1]
        try:
            uid = int(last["uid"]) +1
        except __HOLE__:
            alluids = []
            for _mailbox in self.spam.keys():
                for item in self.spam[_mailbox]:
                    try:
                        alluids.append(int(item["uid"]))
                    except:
                        pass
            if len(alluids) > 0:
                uid = max(alluids) + 1
            else:
                uid = 1
        flags = "FLAGS " + flags
        item = {"uid": str(uid), "headers": message, "complete": message, "flags": flags}
        self.spam[mailbox].append(item)
        return ("OK", "spam spam %s spam" % uid)
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/mockimaplib.py/Connection.append