Weinreich, Nico
2012-Sep-07 07:30 UTC
[Dovecot] Found bug on doing IMAP search with UTF8 chars
Hi! I'm using Roundcube 0.9git as mail frontend and have installed Dovecot 2.1.7 on Debian Squeeze. When searching for mail via Roundcube and the keyword contains "special" chars (like german umlauts), then Dovecot seems to die when the folder does not contain a message which contains this keyword, i.e. folder contains message /w subject "Dies ist eine Nachricht" => search for "Nachricht" => Roundcube shows that messages folder contains message /w subject "Dies ist eine Nachricht" => search for "Nachricht123" => Roundcube shows error that no messages where found folder contains message /w subject "Aufl?sung der Frage" => search for "L?sung" => Roundcube shows that messages folder contains message /w subject "Aufl?sung der Frage" => search for "L?sung123" => Roundcube shows error saying: "Connection to storage server failed" Looking into /var/log/mail.log shows: Sep 5 11:43:32 mail dovecot: imap(abc at def.de): Panic: search key not utf8: L.sung123 dsr_sub_allocation Sep 5 11:43:32 mail dovecot: imap(abc at def.de): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0x4478a) [0 x7f065ba8e78a] -> /usr/lib/dovecot/libdovecot.so.0(+0x447d6) [0x7f065ba8e7d6] -> /usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f065ba655ef ] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0x9a3cb) [0x7f065bd6f3cb] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0x9a8aa) [0x7f065bd6f8 aa] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0x78641) [0x7f065bd4d641] -> /usr/lib/dovecot/libdovecot-storage.so.0(mail_search_args_fore ach+0x3c) [0x7f065bd4d7bc] -> /usr/lib/dovecot/libdovecot.so.0(message_parse_header+0x29) [0x7f065ba78eb9] -> /usr/lib/dovecot/libdovecot-st orage.so.0(+0x9a0cf) [0x7f065bd6f0cf] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0x9b160) [0x7f065bd70160] -> /usr/lib/dovecot/libdovecot- storage.so.0(index_storage_search_next_nonblock+0x48) [0x7f065bd706e8] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_search_next_nonbl ock+0x27) [0x7f065bd51a07] -> dovecot/imap() [0x41668f] -> dovecot/imap(imap_search_start+0xd8) [0x416ad8] -> dovecot/imap(cmd_sort+0x1e6) [ 0x40e636] -> dovecot/imap(command_exec+0x3d) [0x41157d] -> dovecot/imap() [0x4104fe] -> dovecot/imap(client_handle_input+0x135) [0x410805] -> dovecot/imap(client_input+0x5f) [0x41112f] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x36) [0x7f065ba9a926] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x9f) [0x7f065ba9b95f] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x28) [0x7f065ba9a8c8] -> /usr/li b/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f065ba87053] -> dovecot/imap(main+0x2a4) [0x419354] -> /lib/libc.so.6(__libc_start_ma in+0xfd) [0x7f065b706c8d] -> dovecot/imap() [0x408e79] Huh? This error only occurs when I search for a keyword, that contains probably non-ASCII-US chars (like umlauts, euro sign EUR ...) and no message was found in that folder. When there is any message which contains this keyword, then Roundcube is fine and there error above cannot be found in mail.log. Can anybody confirm this behaviour? Regards
Timo Sirainen
2012-Sep-11 16:19 UTC
[Dovecot] Found bug on doing IMAP search with UTF8 chars
On 7.9.2012, at 10.30, Weinreich, Nico wrote:> I'm using Roundcube 0.9git as mail frontend and have installed Dovecot 2.1.7 on Debian Squeeze. When searching for mail via Roundcube and the keyword contains "special" chars (like german umlauts), then Dovecot seems to die when the folder does not contain a message which contains this keyword, i.e. > > Sep 5 11:43:32 mail dovecot: imap(abc at def.de): Panic: search key not utf8: L.sung123 dsr_sub_allocationThis crash was fixed in v2.1.8 I think.> Huh? This error only occurs when I search for a keyword, that contains probably non-ASCII-US chars (like umlauts, euro sign EUR ...) and no message was found in that folder. When there is any message which contains this keyword, then Roundcube is fine and there error above cannot be found in mail.log. Can anybody confirm this behaviour?The error is that Roundcube doesn't send the string to Dovecot as UTF8 (or alternatively specify the correct charset). Even with the crashfix the search won't work.