Closed Bug 243625 Opened 20 years ago Closed 20 years ago

Unable to search cyrillic oin IMAP folders

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ezh, Assigned: Bienvenu)

References

Details

(Keywords: fixed-aviary1.0)

Attachments

(1 file)

1. Open the search dialog (CTRL-Shift-F)
2. Type in the search field some cyrillic text
3. Hit enter - "The mail server responded: bogus criteria list in UID SEARCH".

thunderbird 20040512 (trunk) and IMAP boxes
Summary: Unable to search cyrillic → Unable to search cyrillic oin IMAP folders
Mozilla Mail / Thunderbird use wrong form for search
. SEARCH CHARSET KOI-8 HEADER Subject "some koi8 text" 

Correct form is:
. SEARCH CHARSET KOI8-R HEADER Subject {14}
some koi8 text
Either <string> form should be acceptable, quoted or literal, according to rfc 2060.
first form is accepted, but only for us-ascii (7-bit) strings.

In RFC 3501 I see second form as example for UTF-8 search.

And first form do not work with UW-IMAP for non-ascii strings.
Second form works well with KOI-8 strings with UW-IMAP.
But maybe other servers support both.

additional info

Cyrus Imapd 2.1.16 support both forms
maybe better fix uw-imapd...
FYI:
Mark Crispin <mrc@CAC.Washington.EDU> from UW wrote:

If, as reported, Mozilla is sending KOI8-R strings as quoted strings, Mozilla is
in violation of the IMAP specification.

Quoted strings are only permitted to accept 7-bit characters.  The syntax rules
ultimate lead to CHAR, which is defined in RFC 2234 as 7-bit.  Only literals may
contain 7-bit (CHAR8) characters.  This is stipulated in both RFC 3501 (the
current specification) and RFC 2060 (the previous specification).

David Bienvenu is mistaken in saying that both are permitted.  My guess is that
he did not realize that KOI8-R characters are 8-bit.  For David's benefit:
KOI8-R is a commonly used character set in Russia.  The low half of the
character set (0x00 - 0x7f) is the same as ASCII, and the high half is used for
Cyrillic and other characters commonly used in Russia. Usually, when people say
"KOI8 text" they are referring to text which contains those high-half characters.

If, as reported, Cyrus imapd accepts quoted strings with 8-bit characters, this
is permissiveness on the part of Cyrus for something that is not permitted in
the specification.  This is unusual, since Cyrus imapd normally is very strict
about enforcing the rules of IMAP, at times even more strict than UW imapd.

Nevertheless, it is undefined behavior what a server does when the client sends
it bad syntax.  The server could (and should) issue an error.  It may simply
accept the 8-bit characters.  It may accept the 8-bit characters, but turn off
all the 0x80 bits to make it proper 7-bit.  It may treat it as a command to send
spam to every email address in the planet.  What I'm getting at is that the
underlying fault is in the client.

Consequently, the correct action is to fix Mozilla to send 8-bit characters only
as literals, as required by RFC 3501.

> Please take a look on Mozilla bug 243625
> (http://bugzilla.mozilla.org/show_bug.cgi?id=243625)
>
> Looks like mozilla sens imap serch in form
> . SEARCH CHARSET KOI8-R HEADER Subject "koi8 text"
>
> but UW-IMAP undestand only another form:
>
> . SEARCH CHARSET KOI8-R HEADER Subject {9}
> koi8 text
>
> Is this correct?
> Cyrus IMAPD understand both forms


-- Mark --
 
Attached patch proposed fixSplinter Review
use string literals if imap search terms contain non-7 bit ascii chars.
Attachment #151555 - Flags: superreview?(mscott)
Attachment #151555 - Flags: superreview?(mscott) → superreview+
fix checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Keywords: fixed-aviary1.0
Resolution: --- → FIXED
Product: MailNews → Core
*** Bug 164141 has been marked as a duplicate of this bug. ***
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: