add feature to consume imap mail als .eml

This commit is contained in:
phail 2022-04-15 14:40:02 +02:00
parent 5fcf1b5434
commit cca576f518
4 changed files with 149 additions and 62 deletions

View file

@ -56,6 +56,14 @@ class MailRule(models.Model):
verbose_name = _("mail rule")
verbose_name_plural = _("mail rules")
class ConsumptionScope(models.IntegerChoices):
ATTACHMENTS_ONLY = 1, _("Only process attachments.")
EML_ONLY = 2, _("Process full Mail (with embedded attachments in file) as .eml")
EVERYTHING = 3, _(
"Process full Mail (with embedded attachments in file) as .eml "
"+ process attachments as separate documents",
)
class AttachmentProcessing(models.IntegerChoices):
ATTACHMENTS_ONLY = 1, _("Only process attachments.")
EVERYTHING = 2, _("Process all files, including 'inline' " "attachments.")
@ -144,6 +152,12 @@ class MailRule(models.Model):
),
)
consumption_scope = models.PositiveIntegerField(
_("consumption scope"),
choices=ConsumptionScope.choices,
default=ConsumptionScope.ATTACHMENTS_ONLY,
)
action = models.PositiveIntegerField(
_("action"),
choices=AttachmentAction.choices,