[ https://issues.apache.org/jira/browse/JAMES-2530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594550#comment-16594550 ]
Tellier Benoit commented on JAMES-2530: --------------------------------------- https://github.com/linagora/james-project/pull/1693 contributed full storage for rule fields in serialized events > [Filter] Implement JMAP layer > ------------------------------ > > Key: JAMES-2530 > URL: https://issues.apache.org/jira/browse/JAMES-2530 > Project: James Server > Issue Type: Improvement > Components: JMAP > Reporter: Gautier DI FOLCO > Assignee: Antoine Duprat > Priority: Major > > h1. JMap filtering spec > A Filter is a per-user singleton ordered list of Rules. > For each received mail the Filter is triggered by walk in the order through > the Rule until a condition is met, which selects the corresponding Rule. > Once the selection is done, the action part is executed and we consider the > filtering as done. > h2. Objects > h3. Rule > - id: String > - name: String > - condition: Condition > - action: Action > h3. Action > - mailboxIds: [String] > h3. Condition > - field: String we manage the following fields: from, to, cc, subject, > recipient (to or cc) > - comparator: String we manage the following behavior: contains, > not-contains, exactly-equals, not-exactly-equals > value: String > h2. Methods > h3. setFilter > setFilter takes only one parameter which is all the Rules. > {code:java} > [[ > "setFilter", > { "ifInState": "4011", //can be null > "singleton": [ > { > "id": "42-ac", > "name": "My first rule" > "condition": { > "field": "from", > "comparator": "exactly-equals" > "value": "marvin@h2.g2" > }, > "action": { > "mailboxIds": ["5"] > } > }, > { > "id": "3000-34e", > "name": "My last rule" > "condition": { > "field": "subject", > "comparator": "contains" > "value": "question" > }, > "action": { > "mailboxIds": ["7", "2", "5"] > } > } > ]}, > "#0" > ]]{code} > h3. getFilter > getFilter takes no parameters and returns the filter with all the Rules. > {code:java} > { > "getFilter", > {}, > "#0" > }{code} > Will return: > {code:java} > [[ > "filter", > { "state": "4012", > "singleton": [ > { > "id": "42-ac", > "name": "My first rule" > "condition": { > "field": "from", > "comparator": "exactly-equals" > "value": "marvin@h2.g2" > }, > "action": { > "mailboxIds": ["5"] > } > }, > { > "id": "3000-34e", > "name": "My last rule" > "condition": { > "field": "subject", > "comparator": "contains" > "value": "question" > }, > "action": { > "mailboxIds": ["7", "2", "5"] > } > } > ]}, > "#0" > ]]{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org