[Dovecot] bug in dovecot search
A007 search from phyllis
- SEARCH 484
A007 UID SEARCH CHARSET "US-ASCII" ALL FROM {7} phyllis
- SEARCH
007 UID SEARCH CHARSET "US-ASCII" ALL FROM "phyllis"
- SEARCH
Regards,
Cor
Which version of Dovecot (and which OS)?
This works fine for me in 1.0-stable and 1.0-test78 on Solaris:-
. UID SEARCH CHARSET "US-ASCII" ALL FROM "steve"
- SEARCH 8844 8851 9146 23739 24273 . OK Search completed. . UID SEARCH CHARSET "US-ASCII" ALL FROM {5}
- OK steve
- SEARCH 8844 8851 9146 23739 24273 . OK Search completed. . SEARCH from steve
- SEARCH 91 95 107 732 977 . OK Search completed.
Best Wishes, Chris
Cor Bosman wrote:
A007 search from phyllis
- SEARCH 484
A007 UID SEARCH CHARSET "US-ASCII" ALL FROM {7} phyllis
- SEARCH
007 UID SEARCH CHARSET "US-ASCII" ALL FROM "phyllis"
- SEARCH
Regards,
Cor
-- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
Which version of Dovecot (and which OS)?
test78, FreeBSD 4.10. My previous message didnt show the real issue..
. UID search ALL FROM "phyllis"
- SEARCH 1351 . OK Search completed.
. UID SEARCH CHARSET "US-ASCII" ALL FROM "phyllis"
- SEARCH . OK Search completed.
The RFC says:
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.
Now, the FROM in question looks like:
From: =?windows-1251?B?cGh5bGxpc0BhbGFjYXJ0YS5jb20g?= suvro@wartaponsel.com
The windows encoded string says "phyllis@alacarta.com"
Since the CHARSET applies to the search criteria, and not to the header that is searched, isnt this supposed to return the same UIDs?
Cor
On Fri, 2005-07-15 at 14:00 +0200, Cor Bosman wrote:
. UID search ALL FROM "phyllis" .. . UID SEARCH CHARSET "US-ASCII" ALL FROM "phyllis"
Since the CHARSET applies to the search criteria, and not to the header that is searched, isnt this supposed to return the same UIDs?
Yes. Dovecot's internal handling is different though. If you don't specify character set, it compares the strings directly. If you do, it attempts to do conversions to UTF-8 for both search key and each existing header.
If you didn't compile with iconv support, or if it didn't support windows-1251 charset I guess this could have happened. I'll change the code so that it tries to compare it even if the charset translation fails, so ASCII comparing at least works correctly. See if it works in upcoming test79 or CVS.
participants (3)
-
Chris Wakelin
-
Cor Bosman
-
Timo Sirainen