mark mails as processed internally, don't process processed mails again

This commit is contained in:
Jonas Winkler
2023-02-21 13:50:34 +01:00
parent 7e1c1da424
commit a37177703c
3 changed files with 162 additions and 21 deletions

View File

@@ -214,3 +214,40 @@ class MailRule(document_models.ModelWithOwner):
def __str__(self):
return f"{self.account.name}.{self.name}"
class ProcessedMail(document_models.ModelWithOwner):
rule = models.ForeignKey(
MailRule,
null=False,
blank=False,
on_delete=models.CASCADE,
)
folder = models.CharField(
_("folder"),
null=False,
blank=False,
max_length=256,
)
uid = models.CharField(
_("folder"),
null=False,
blank=False,
max_length=256,
)
status = models.CharField(
_("status"),
null=False,
blank=False,
max_length=256,
)
error = models.TextField(
_("error"),
null=True,
blank=True,
)