[jira] [Closed] (JAMES-4148) Webadmin: Ability to run filtering rules on folders

"Benoit Tellier (Jira)" <[email protected]> Fri, 13 Mar 2026 21:51:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.james.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/JAMES-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Tellier closed JAMES-4148.
---------------------------------
    Resolution: Fixed

Merged

> Webadmin: Ability to run filtering rules on folders
> ---------------------------------------------------
>
>                 Key: JAMES-4148
>                 URL: https://issues.apache.org/jira/browse/JAMES-4148
>             Project: James Server
>          Issue Type: Improvement
>            Reporter: René Cordier
>            Priority: Major
>          Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> Use a rule (jmap filtering) against a folder content and use it to sort messages,
> API:
> {code:bash}
> curl -XPOST /users/mailboxes/:id?messages?action=triage
> curl -XPOST /messages?action=triage&(mailboxName=Archives)
> {
>   "id": "1",
>   "name": "My first rule",
>   "conditionGroup": {
>     "conditionCombiner": "AND",
>     "conditions": [
>       {
>         "field": "subject",
>         "comparator": "contains",
>         "value": "question"
>       },
>       {
>         "field": "header:X-custom",
>         "comparator": "contains",
>         "value": "cguivgwelrf"
>       },
>       {
>         "field": "header:X-custom",
>         "comparator": "contains",
>         "value": "cguivgwelrf"
>       },
>       {
>         "field": "flag",
>         "comparator": "isSet",
>         "value": "\Seen"
>       },
>       {
>         "field": "flag",
>         "comparator": "isUnset",
>         "value": "\Important"
>       },
>       {
>         "field": "flag",
>         "comparator": "isSet",
>         "value": "xyz"
>       },
>       {
>         "field": "savedDate",
>         "comparator": "isOlderThan",
>         "value": "30d"
>       },
>       {
>         "field": "internalDate",
>         "comparator": "isOlderThan",
>         "value": "30d"
>       },
>       {
>         "field": "from",
>         "comparator": "contains",
>         "value": "user2"
>       }
>     ]
>   }
>   "action": {
>     "moveTo": {
>       "mailboxName": "Trash"
>     }
>   }
> }
> {code}
> Steps to implement:
>  - [ ] Ability to run  RuleMatcher on MessageResult and not just mails
>  - [ ] Webadmin endpoint + task to run a rule against a folder
>  - [ ] Webadmin endpoint to run a rule cluster wide (generate tasks to run a rule against a folder - do not write new task)
>  - [ ] Conditions for 'stock': flag, savedDate, internalDate evaluated on message results but skept in Mail
>  - [ ] Action 'moveTo' based on a mailbox name (needed to trun mass treatment on several users as we cannot hard code mailboxid)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)