afterlogic / webmail-lite-8

Open-source webmail script for existing IMAP server
https://afterlogic.org/webmail-lite-8
GNU Affero General Public License v3.0
335 stars 71 forks source link

Searching emails - issue when orthography #71

Closed MrShippeR closed 3 years ago

MrShippeR commented 3 years ago

Hello, i think problem is about formating search sentence to mail hosting. There is probably missing support of UTF-8. Could someone who understant problematic fill the gap and edit code to support UTF-8, please?

I get error: Neznámá chyba. (TAG6 NO SORT: mtd: internal error: SEARCH Syntax error (Bad token)

when I try to search any word with czech orthography like "česko" = czech
Snímek z 2020-11-02 22-24-37

afterlogic-support commented 3 years ago

This might actually be caused by UTF8 support missing for search on mail server side. To look into this further, we'd need debug logs recorded when performing IMAP search.

MrShippeR commented 3 years ago

Debug log in attachment for search word "česko". Thank you for your helping. log-2020-11-03.txt

MrShippeR commented 3 years ago

Email provider is seznam.cz. I'm using domain email.cz there, but domain shouldn't matter. Setting for email client is here. For case of duplication my situation.

afterlogic-support commented 3 years ago

Indeed, it looks like this particular mail server doesn't support UTF8 search, you may wish to contact their support in this regard. On our own server, using WebMail Lite live demo, such a search is performed just fine.

MrShippeR commented 3 years ago

Seems they are using RFC 2822 or RFC 5322

Please, where can I find line of used formating and replace UTF-8 by one of these? [07:01:45.66][52fe9649] IMAP[DATA]: > TAG6 UID SORT (REVERSE ARRIVAL) UTF-8 OR OR OR FROM "česko" TO "česko" CC "česko" SUBJECT "česko"\r\n

afterlogic-support commented 3 years ago

getMessagesInfo function in modules/Mail/Managers/Main/Manager.php file would be a starting point.

By the way, you can try replacing the following line therre:

bUseSortIfSupported = $oImapClient->IsSupported('SORT'); 

with:

bUseSortIfSupported = false; 

There's a chance this will help, if mail server can't handle SORT but can do simple SEARCH.