Cyrus 2.4 IMAP SEARCH

Greg Banks gnb at fastmail.fm
Mon Jul 2 04:46:09 EDT 2012


G'day,

As I'm looking at the Cyrus search code for other reasons, I thought I'd
field this one.

On Fri, Jun 29, 2012, at 12:57 PM, David Carter wrote:
> 
> RFC 3501, section 6.4.4 "SEARCH Command" says:
> 
>     In all search keys that use strings, a message matches the key if
>     the string is a substring of the field.  The matching is
>     case-insensitive.
> 
> and I guess "" is strictly speaking a substring of all other strings.
>

Ah, the good old days when RFCs could be written assuming one language,
four timezones and one hemisphere and everybody Just Knew What You
Meant.  As far as I can see there is absolutely no definition of either
"substring" or "case-insensitive" in RFC3501 or any of the documents it
references.

These days however we have Unicode and in particular RFC 5051 which
tells us how to handle text when sorting and searching.  That document
references RFC 4790, section 4.2.3 of which has a useful working
definition of what a comparator's substring operation can do, including
this

>   A string is a substring of itself.  The empty string is a substring of all strings.

which is quite clear.  So your guess is correct, and Cyrus 2.4 is
behaving incorrectly.  Please raise a Bugzilla.

> Was this a deliberate change

It's difficult to tell without figuring out who changed it and asking
them, but I'm guessing "no" :)

>  or just a consequence of the search engine 
> being reworked in 2.4? I don't imagine that it is a very common problem.

It does seem like a corner case.

-- 
Greg.


More information about the Info-cyrus mailing list