]> git.proxmox.com Git - pmg-api.git/commit
RuleCache: implement and/invert for what matches
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 21 Feb 2024 12:24:35 +0000 (13:24 +0100)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 21 Feb 2024 18:30:13 +0000 (19:30 +0100)
commitfe7eae4e7c6e6517c34f9dc19edaaac50dd552f6
tree18d737c38a3f22d7f79410a8dc241ca97844a4c3
parentc9cd35e4738421b982b986f7393edac335b8c8d5
RuleCache: implement and/invert for what matches

Since what matches are not a simple boolean match, but also can contain
"marks" to mark specific parts of the mail, we must implement some
custom logic for and/invert here.

The goal here is to define that groups are on a per part level,
but the rule operates on the whole mail.

To achieve this we have two different and/invert combine functions, one
for the group level and one for the whole what match.

For per group and/inversion we and 'and-combine' and invert the list of
marks, so if it matches part 1,2 of 1,2,3 the inversion would return 3.

For the rule it only matters if the and/inversion part matches at all,
regardless of the marks. If it matches, the marks will be or'ed.

With this, one can represent many different scenarios that were not
possible before.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PMG/RuleCache.pm
src/PMG/RuleDB/Remove.pm