def process_message(self, peer, mailfrom, rcpttos, data): # We can assume that the mailfrom and rcpttos have checked out # and this message is indeed intended for us. Spool it to disk # and add to the index! session, config = self.session, self.session.config blank_tid = config.get_tags(type='blank')[0]._key idx = config.index play_nice_with_threads() try: message = email.parser.Parser().parsestr(data) lid, lmbox = config.open_local_mailbox(session) e = Email.Create(idx, lid, lmbox, ephemeral_mid=False) idx.add_tag(session, blank_tid, msg_idxs=[e.msg_idx_pos], conversation=False) e.update_from_msg(session, message) idx.remove_tag(session, blank_tid, msg_idxs=[e.msg_idx_pos], conversation=False) return None except: traceback.print_exc() return '400 Oops wtf'
def process_message(self, peer, mailfrom, rcpttos, data): # We can assume that the mailfrom and rcpttos have checked out # and this message is indeed intended for us. Spool it to disk # and add to the index! session, config = self.session, self.session.config blank_tid = config.get_tags(type='blank')[0]._key idx = config.index try: message = email.parser.Parser().parsestr(data) lid, lmbox = config.open_local_mailbox(session) e = Email.Create(idx, lid, lmbox, ephemeral_mid=False) idx.add_tag(session, blank_tid, msg_idxs=[e.msg_idx_pos], conversation=False) e.update_from_msg(session, message) idx.remove_tag(session, blank_tid, msg_idxs=[e.msg_idx_pos], conversation=False) return None except: traceback.print_exc() return '400 Oops wtf'