def __init__(self, force = False): self.metadata = make_metadata(email_engine) self.queue_table = mail_queue(self.metadata) indices = [index_str(self.queue_table, "date", "date"), index_str(self.queue_table, 'kind', 'kind')] create_table(self.queue_table, indices, force = force) self.opt_table = opt_out(self.metadata) indices = [index_str(self.opt_table, 'email', 'email')] create_table(self.opt_table, indices, force = force) self.track_table = sent_mail_table(self.metadata) self.reject_table = sent_mail_table(self.metadata, name = "reject_mail") def sent_indices(tab): indices = [index_str(tab, 'to_addr', 'to_addr'), index_str(tab, 'date', 'date'), index_str(tab, 'ip', 'ip'), index_str(tab, 'kind', 'kind'), index_str(tab, 'fullname', 'fullname'), index_str(tab, 'account_id', 'account_id'), index_str(tab, 'msg_hash', 'msg_hash'), ] create_table(self.track_table, sent_indices(self.track_table), force = force) create_table(self.reject_table, sent_indices(self.reject_table), force = force)
def sent_indices(tab): indices = [index_str(tab, 'to_addr', 'to_addr'), index_str(tab, 'date', 'date'), index_str(tab, 'ip', 'ip'), index_str(tab, 'kind', 'kind'), index_str(tab, 'fullname', 'fullname'), index_str(tab, 'account_id', 'account_id'), index_str(tab, 'msg_hash', 'msg_hash'), ]