Benoit Tellier created JAMES-3391:
-------------------------------------
Summary: Email/query Allow filtering by body
Key: JAMES-3391
URL: https://issues.apache.org/jira/browse/JAMES-3391
Project: James Server
Issue Type: Sub-task
Reporter: Benoit Tellier
As a user i want to be able to for a value in any text part of a mail body
{code:java}
body: String Looks for the text in one of the body parts of the message. The
server MAY exclude MIME body parts with content media types other than text/*
and message/* from consideration in search matching. Care should be taken to
match based on the text content actually presented to an end user by viewers
for that media type or otherwise identified as appropriate for search indexing.
Matching document metadata uninteresting to an end user (e.g., markup tag and
attribute names) is undesirable.
{code}
### Why
As an user i want to be able to select the mail by searching for a text in
those text body parts like this :
{code:java}
[[ "Email/query",{
"accountId": "ue150411c",
"filter": {
"body": "james"
}
}, "0" ]]
{code}
should return the emails containing 'james' in any text/* parts of its body.
For text/html parts it should only return text exposed to the user.
No attributes or tags name.
### HOW
- accept a simple FilterCondition with an optional 'body' 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.* in
the text exposed to the user.
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 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 cannot filter the email with a
value contained in an attribute name of a text/html part of the body
- write integration demonstrating that a user cannot filter the email with a
value contained in a tag name of 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]