linagora / james-project

Mirror of Apache James Project
Apache License 2.0
71 stars 62 forks source link

JAMES-1489 IMAP/ Search function > IMAP cannot search the keyword contains special characters #4300

Closed tlle14 closed 2 years ago

tlle14 commented 3 years ago

Actual Result

When search with keyword contains special characters, the search always returns no result Example: Keyword Đây là một email test 1=1;- Peek 2021-03-26 10-07

Expected Result

IMAP should be able to search with a special characters keyword

Environment

chibenwa commented 3 years ago

https://issues.apache.org/jira/browse/JAMES-1489 is related

chibenwa commented 3 years ago

OK, this SHOULD be easy: We loose a charset somewhere...

https://tools.ietf.org/html/rfc3501#section-6.4.4

      The OPTIONAL [CHARSET] specification consists of the word
      "CHARSET" followed by a registered [CHARSET].  It indicates the
      [CHARSET] of the strings that appear in the search criteria.
      [MIME-IMB] content transfer encodings, and [MIME-HDRS] strings in
      [RFC-2822]/[MIME-IMB] headers, MUST be decoded before comparing
      text in a [CHARSET] other than US-ASCII.  US-ASCII MUST be
      supported; other [CHARSET]s MAY be supported.

      If the server does not support the specified [CHARSET], it MUST
      return a tagged NO response (not a BAD).  This response SHOULD
      contain the BADCHARSET response code, which MAY list the
      [CHARSET]s supported by the server.

I do not see charset support TBH.

-> Step 1: Support ASCII charset only -> Step 2: Support ASCII charset...

chibenwa commented 3 years ago

Ok, 2 problems:

chibenwa commented 3 years ago

Edit:

chibenwa commented 2 years ago

https://github.com/apache/james-project/pull/980 is my renewed take on this.