Roundcube Community Forum

 

Search Errors

Started by tary, October 03, 2011, 12:44:55 PM

Previous topic - Next topic

tary

Hello,
I'm new to Roundcube and I'm trying the "search" feature but no matter what I search on I'm getting an error: Server error: unable to send command A00006 SEARCH CHARSET US ASCII TEXT {4}test." Where "test" is the actual string I was searching on...Am I supposed to put something other than the string to be searched in that box? Can anyone give me suggestions on what to try? I'm using a citadel imap server and I've tried the search features in both webcit and squirrelmail and they work ok.
Thank you!
Tary

alec

It could be Citadel's bug. Enable imap_debug in Roundcube and check the log.

tary

I thought it might be a citadel error but other clients like webcit and squirrelmail completed searches successfully and the Roundcube imap log doesn't show an error:
S: A0004 OK [READ-WRITE] SELECT completed
C: A0005 SEARCH CHARSET UTF-8 TEXT {5}
S: *  SEARCH
C: A0006 SEARCH CHARSET US-ASCII TEXT {5}
S: A0005 OK SEARCH completed
C: A0007 LOGOUT

Any thing else I can try?
Thanks.
Tary

alec

C: A0006 SEARCH CHARSET US-ASCII TEXT {5}
S: A0005 OK SEARCH completed

The server shouldn't response OK, after the first line. This is server's bug. I can imagine a workaround for this, but will need a test account on your server, so I could connect from my box and test the solution. Write to alec at alec.pl if you can provide such account.

alec

Check with this patch.
[ATTACH=CONFIG]1759[/ATTACH]

tary

I tried to patch the file but received the following error:

patching file rcube_imap_generic.php
Hunk #1 succeeded at 1218 (offset -93 lines).
Hunk #2 succeeded at 1966 (offset -74 lines).
Hunk #3 succeeded at 2020 (offset -74 lines).
Hunk #4 FAILED at 3405.
Hunk #5 succeeded at 3349 (offset -162 lines).
1 out of 5 hunks FAILED -- saving rejects to file rcube_imap_generic.php.rej

root@mccmail:/usr/share/roundcube/program/include
# more *rej

--- rcube_imap_generic.php      (wersja 5308)
+++ rcube_imap_generic.php      (kopia robocza)
@@ -3405,18 +3409,18 @@
         return $num == 1 ? $result[0] : $result;
     }

-    static function r_implode($element)
+    static function r_implode($element, $escape = false)

     {
         $string = '';
 
         if (is_array($element)) {
             reset($element);
             while (list($key, $value) = each($element)) {
-                $string .= ' ' . self::r_implode($value);
+                $string .= ' ' . self::r_implode($value, $escape);
             }
         }
         else {

-            return $element;
+            return $escape ? self::escape($element) : $element;
         }
           return '(' . trim($string) . ')';

What can  I do? I really appreciate your help with this.
Thanks.
Tary

tary

As a test, I manually entered the code that failed in the patch...I no longer get the server error, but it doesn't find any matches. It always comes back "Server found no matches" no matter what string I search on. Also, in the log it has SEARCH CHARSET UTF-8 where it used to be CHARSET US ASCII?

Thanks.
Tary

alec

How the log looks like now? Could you debug IMAP commands from squirrel?