[ 
https://issues.apache.org/jira/browse/JAMES-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

René Cordier updated JAMES-4148:
--------------------------------
    Description: 
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)

  was:
## what

Use a rule (jmap filtering) against a folder content and use it to sort 
messages,

API:

```
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"
    }
  }
}
```

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)


> 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
>
> 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)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to