E-mail filter rules – system description

Storage, validation and permissions of the static message-level and attachment-level rules applied during import.

Overview

Filter rules run in the second step of the import chain (see the incoming e-mail system description) and again as a PDF-based post-filter after PDF text extraction. Table names carry the installation's own prefix in the database.

Data model

TableMain fields
email_filtername, scope (email, attachment), action, conditions (sender, domain, subject, PDF text, file name, MIME, maximum size), target type and target id, subject regex, invoice number regex, supplier keyword, priority, note, status

Validation

  1. Name required; scope only email or attachment.
  2. Action: skip, ignore, link_invoice, link_task, link_partner, link_invoice_by_pdf.
  3. At least one condition (error_no_match).
  4. link_invoice_by_pdf needs the invoice number regex; the other link_* actions need a target id or a subject regex (error_link_target).

Saving and deleting use filter.save and filter.delete; deletion checks no references.

Permissions

  • Layer 1: list with base access permission, save and delete with base modify permission.
  • Layer 2: the header "+" button follows canAction(add); the debug key is checked. The list key is not checked with canAction; the functions are UNMAPPED.
  • Layer 3: no content scope.
Related topics: e-mail rule permissions