Author Topic: Search Errors  (Read 3636 times)

Offline tary

  • Newbie
  • *
  • Posts: 5
Search Errors
« on: October 03, 2011, 12:44:55 PM »
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

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Search Errors
« Reply #1 on: October 04, 2011, 02:30:24 AM »
It could be Citadel's bug. Enable imap_debug in Roundcube and check the log.

Offline tary

  • Newbie
  • *
  • Posts: 5
Search Errors
« Reply #2 on: October 04, 2011, 07:14:00 PM »
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

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Search Errors
« Reply #3 on: October 05, 2011, 06:32:40 AM »
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.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Search Errors
« Reply #4 on: October 05, 2011, 09:46:40 AM »
Check with this patch.
[ATTACH=CONFIG]1759[/ATTACH]

Offline tary

  • Newbie
  • *
  • Posts: 5
Search Errors
« Reply #5 on: October 07, 2011, 11:53:51 AM »
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

Offline tary

  • Newbie
  • *
  • Posts: 5
Search Errors
« Reply #6 on: October 07, 2011, 12:14:28 PM »
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

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Search Errors
« Reply #7 on: October 08, 2011, 02:32:52 AM »
How the log looks like now? Could you debug IMAP commands from squirrel?