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

Benoit Tellier updated JAMES-3392:
----------------------------------
    Description: 
As a user i want to be able to for a value in  any text part of a mail body and 
its From, To, Cc, Bcc, and Subject header fields

{code:java}
text: String Looks for the text in Emails. The server MUST look up text in the 
From, To, Cc, Bcc, and Subject header fields of the message and SHOULD look 
inside any text/* or other body parts that may be converted to text by the 
server. The server MAY extend the search to any additional textual property.
{code}

### Why

As an user i want to be able to select the mail by searching for a text in 
those headers or body text parts like this : 

{code:java}
[[ "Email/query",{
  "accountId": "ue150411c",
  "filter":  {
     "text": "james"
}
}, "0" ]]
{code}


should return the emails containing 'james' in  their From, To, Cc, Bcc, and 
Subject  headers or in any text/* parts of its body

### HOW

- accept a simple FilterCondition with an optional 'text' field

- filter the query with those parameters. It don't need to be an exact match. 
For the result to appear any fields should contains the value : .*value.*

The exact semantics for matching String fields is deliberately not defined to 
allow for flexibility in indexing implementation, subject to the following:

{code:java}
    Any syntactically correct encoded sections [@!RFC2047] of header fields 
with a known encoding SHOULD be decoded before attempting to match text.
    When searching inside a text/html body part, any text considered markup 
rather than content SHOULD be ignored, including HTML tags and most attributes, 
anything inside the <head> tag, Cascading Style Sheets (CSS) and JavaScript. 
Attribute content intended for presentation to the user such as “alt” and 
“title” SHOULD be considered in the search.
    Text SHOULD be matched in a case-insensitive manner.

    Text contained in either (but matched) single (‘) or double (“) quotes 
SHOULD be treated as a phrase search; that is, a match is required for that 
exact word or sequence of words, excluding the surrounding quotation marks.
{code}


### Definition of Done

- write integration by supported header fields _From, To, Cc, Bcc, and Subject_ 
 demonstrating that a user can filter the email containing the searched value 
in any of those fields.
- write integration demonstrating that a user can filter the email  with a 
value contained in a text/plain part of the body
- write integration demonstrating that a user can filter the email  with a 
value contained in a text/html part of the body
- write integration demonstrating that a user can filter the email  with a 
value contained in a text part of a multipart mail



> Email/query Allow filtering by text
> -----------------------------------
>
>                 Key: JAMES-3392
>                 URL: https://issues.apache.org/jira/browse/JAMES-3392
>             Project: James Server
>          Issue Type: Sub-task
>          Components: JMAP
>            Reporter: Benoit Tellier
>            Assignee: Antoine Duprat
>            Priority: Major
>             Fix For: 3.6.0
>
>
> As a user i want to be able to for a value in  any text part of a mail body 
> and its From, To, Cc, Bcc, and Subject header fields
> {code:java}
> text: String Looks for the text in Emails. The server MUST look up text in 
> the From, To, Cc, Bcc, and Subject header fields of the message and SHOULD 
> look inside any text/* or other body parts that may be converted to text by 
> the server. The server MAY extend the search to any additional textual 
> property.
> {code}
> ### Why
> As an user i want to be able to select the mail by searching for a text in 
> those headers or body text parts like this : 
> {code:java}
> [[ "Email/query",{
>   "accountId": "ue150411c",
>   "filter":  {
>      "text": "james"
> }
> }, "0" ]]
> {code}
> should return the emails containing 'james' in  their From, To, Cc, Bcc, and 
> Subject  headers or in any text/* parts of its body
> ### HOW
> - accept a simple FilterCondition with an optional 'text' field
> - filter the query with those parameters. It don't need to be an exact match. 
> For the result to appear any fields should contains the value : .*value.*
> The exact semantics for matching String fields is deliberately not defined to 
> allow for flexibility in indexing implementation, subject to the following:
> {code:java}
>     Any syntactically correct encoded sections [@!RFC2047] of header fields 
> with a known encoding SHOULD be decoded before attempting to match text.
>     When searching inside a text/html body part, any text considered markup 
> rather than content SHOULD be ignored, including HTML tags and most 
> attributes, anything inside the <head> tag, Cascading Style Sheets (CSS) and 
> JavaScript. Attribute content intended for presentation to the user such as 
> “alt” and “title” SHOULD be considered in the search.
>     Text SHOULD be matched in a case-insensitive manner.
>     Text contained in either (but matched) single (‘) or double (“) quotes 
> SHOULD be treated as a phrase search; that is, a match is required for that 
> exact word or sequence of words, excluding the surrounding quotation marks.
> {code}
> ### Definition of Done
> - write integration by supported header fields _From, To, Cc, Bcc, and 
> Subject_  demonstrating that a user can filter the email containing the 
> searched value in any of those fields.
> - write integration demonstrating that a user can filter the email  with a 
> value contained in a text/plain part of the body
> - write integration demonstrating that a user can filter the email  with a 
> value contained in a text/html part of the body
> - write integration demonstrating that a user can filter the email  with a 
> value contained in a text part of a multipart mail



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to