Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1486803 closed Bugs (wontfix)

Search not working in 0.4

Reported by: omehegan Owned by:
Priority: 5 Milestone: 0.4-stable
Component: Core functionality Version: git-master
Severity: major Keywords: search filter bug
Cc: rdle@…, roundcube@…

Description

Search was working for me in 0.3.1, but now that I have upgraded to 0.4b it is not.

In my Inbox I have a message with the subject "Newsletter deadline." In the search box I click the magnifying class, check Subject, then type 'newsletter' and hit enter. I get no results. I'm using Courier IMAP.

Here's the IMAP debug output:

[17-Jun-2010 13:34:27 -0700]: S: * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.
[17-Jun-2010 13:34:27 -0700]: C: cp01 CAPABILITY
[17-Jun-2010 13:34:27 -0700]: S: * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS
[17-Jun-2010 13:34:27 -0700]: S: cp01 OK CAPABILITY completed
[17-Jun-2010 13:34:27 -0700]: C: a001 LOGIN "username redacted" "password redacted"
[17-Jun-2010 13:34:27 -0700]: S: a001 OK LOGIN Ok.
[17-Jun-2010 13:34:27 -0700]: C: sel1 SELECT "INBOX"
[17-Jun-2010 13:34:27 -0700]: S: * FLAGS (NonJunk $NotJunk NotJunk \Draft \Answered \Flagged \Deleted \Seen \Recent)
[17-Jun-2010 13:34:27 -0700]: S: * OK [PERMANENTFLAGS (NonJunk $NotJunk NotJunk \* \Draft \Answered \Flagged \Deleted \Seen)] Limited
[17-Jun-2010 13:34:27 -0700]: S: * 45 EXISTS
[17-Jun-2010 13:34:27 -0700]: S: * 0 RECENT
[17-Jun-2010 13:34:27 -0700]: S: * OK [UIDVALIDITY 1241118298] Ok
[17-Jun-2010 13:34:27 -0700]: S: * OK [MYRIGHTS "acdilrsw"] ACL
[17-Jun-2010 13:34:27 -0700]: S: sel1 OK [READ-WRITE] Ok
[17-Jun-2010 13:34:27 -0700]: C: thrd1 THREAD REFERENCES UTF-8 ALL OR HEADER SUBJECT {5}
[17-Jun-2010 13:34:27 -0700]: S: + OK
[17-Jun-2010 13:34:27 -0700]: C: deadline HEADER FROM {5}
[17-Jun-2010 13:34:27 -0700]: S: + OK
[17-Jun-2010 13:34:27 -0700]: C: deadline
[17-Jun-2010 13:34:27 -0700]: S: thrd1 NO UTF-8 character set is not supported.
[17-Jun-2010 13:34:27 -0700]: C: s SORT (DATE) US-ASCII ALL
[17-Jun-2010 13:34:27 -0700]: S: * SORT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 44 39 40 41 42 43 45
[17-Jun-2010 13:34:27 -0700]: S: s OK SORT done.
[17-Jun-2010 13:34:27 -0700]: C: FH12 FETCH  (UID RFC822.SIZE FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCES DISPOSITION-NOTIFICATION-TO X-PRIORITY X-DRAFT-INFO)])
[17-Jun-2010 13:34:27 -0700]: S: FH12 NO Error in IMAP command received by server.
[17-Jun-2010 13:34:27 -0700]: C: I LOGOUT

I get this in my Roundcubemail error log:

[17-Jun-2010 13:34:27] PHP Warning:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in /whatever/redacted/path/roundcubemail/program/include/rcube_imap.php on line 951

I have tested this in both Safari and Firefox on Mac. Same problem in both.

Change History (13)

comment:1 Changed 3 years ago by alec

  • Milestone changed from later to 0.4-stable
  • Resolution set to fixed
  • Status changed from new to closed

Please, check with svn-trunk version. This has been fixed.

comment:2 Changed 3 years ago by riemerick

  • Cc rdle@… added
  • Keywords search filter bug added
  • Resolution fixed deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened

I'm having the same problem.
Search was working in 0.3.1, but not in 0.4b.

I tried what the changeset 3787 (http://trac.roundcube.net/changeset/3787) shows, but it didn't work:

  • I tried to make changes manually in the three files and didn't work.
  • I tried to replace the three files and didn't work.

The search (filter) doesn't return anything.

comment:3 Changed 3 years ago by alec

Please, describe steps to reproduce more precisely. Describe your environment (php, browsers, imap, os, etc.). Finally enable imap_debug and attach logs/imap file here.

comment:4 Changed 3 years ago by riemerick

Red Hat Enterprise Linux 5.5
PHP 5.2.13
Courier IMAP 4.3.1
Browsers: Mozilla Firefox 3.6.6, Google Chrome 5.0.375.99, Internet Explorer 8

WRITE: a001 OK LOGIN Ok.
READ: ATOM: sel1
READ: ATOM: SELECT
READ: QUOTED_STRING: INBOX
READ: EOL
WRITE: * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1278682686] Ok
* OK [MYRIGHTS "acdilrsw"] ACL
sel1 OK [READ-WRITE] Ok
READ: ATOM: srch1
READ: ATOM: SEARCH
READ: ATOM: CHARSET
READ: ATOM: UTF-8
READ: ATOM: OR
READ: ATOM: HEADER
READ: ATOM: SUBJECT
WRITE: + OK
READ: QUOTED_STRING: new
READ: ATOM: HEADER
READ: ATOM: FROM
WRITE: + OK
READ: QUOTED_STRING: new
READ: EOL
WRITE: srch1 NO UTF-8 character set is not supported.
READ: ATOM: I
READ: ATOM: LOGOUT
READ: EOL
WRITE: * BYE Courier-IMAP server shutting down
I OK LOGOUT completed

comment:5 Changed 3 years ago by alec

  • Version changed from 0.4-beta to svn-trunk

Please, make sure you're using proper files from svn. I'm pretty sure it has been fixed.

comment:6 Changed 3 years ago by riemerick

Thank you for your help, alec.

I replaced manually the files, downloading from the site.
Could you teach me how can I use svn here, please?

comment:7 Changed 3 years ago by alec

Install svn package. Then you can just execute command: svn checkout https://svn.roundcube.net/trunk. In current version when IMAP server returns "NO UTF-8 character set is not supported", Roundcube will try search with US-ASCII. Please, test again with trunk version.

comment:8 Changed 3 years ago by alec

  • Resolution set to worksforme
  • Status changed from reopened to closed

No feedback. Works for me with current trunk.

comment:9 Changed 3 years ago by kitserve

  • Cc roundcube@… added
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Summary changed from Search not working in 0.4b to Search not working in 0.4

I just upgraded to Roundcube 0.4.2 from 0.3.1 and ran into the same bug, search returns no results. I tested with roundcubemail-trunk-r4050/svn-20101006 too, search doesn't work in that for me either. Here's the imap log, searching for the field "roundcube" in Subject:

[21-Oct-2010 22:09:12 +0100]: S: * OK Dovecot ready.
[21-Oct-2010 22:09:12 +0100]: C: cp01 CAPABILITY
[21-Oct-2010 22:09:12 +0100]: S: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS AUTH=PLAIN AUTH=LOGIN
[21-Oct-2010 22:09:12 +0100]: S: cp01 OK Capability completed.
[21-Oct-2010 22:09:12 +0100]: C: a001 LOGIN "user" "password"
[21-Oct-2010 22:09:12 +0100]: S: a001 OK Logged in.
[21-Oct-2010 22:09:12 +0100]: C: sel1 SELECT "INBOX"
[21-Oct-2010 22:09:12 +0100]: S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $MDNSent $Forwarded)
[21-Oct-2010 22:09:12 +0100]: S: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $MDNSent $Forwarded \*)] Flags permitted.
[21-Oct-2010 22:09:12 +0100]: S: * 2025 EXISTS
[21-Oct-2010 22:09:12 +0100]: S: * 0 RECENT
[21-Oct-2010 22:09:12 +0100]: S: * OK [UIDVALIDITY 1184274078] UIDs valid
[21-Oct-2010 22:09:12 +0100]: S: * OK [UIDNEXT 8109] Predicted next UID
[21-Oct-2010 22:09:12 +0100]: S: sel1 OK [READ-WRITE] Select completed.
[21-Oct-2010 22:09:12 +0100]: C: thrd1 THREAD REFERENCES UTF-8 ALL OR HEADER ENTIRE MESSAGE {9}
[21-Oct-2010 22:09:12 +0100]: S: + OK
[21-Oct-2010 22:09:12 +0100]: C: roundcube HEADER SUBJECT {9}
[21-Oct-2010 22:09:12 +0100]: S: + OK
[21-Oct-2010 22:09:12 +0100]: C: roundcube
[21-Oct-2010 22:09:12 +0100]: S: thrd1 NO Unknown argument ROUNDCUBE
[21-Oct-2010 22:09:12 +0100]: C: thrd1 THREAD REFERENCES US-ASCII ALL OR HEADER ENTIRE MESSAGE {9}
[21-Oct-2010 22:09:12 +0100]: S: + OK
[21-Oct-2010 22:09:12 +0100]: C: roundcube HEADER SUBJECT {9}
[21-Oct-2010 22:09:12 +0100]: S: + OK
[21-Oct-2010 22:09:12 +0100]: C: roundcube
[21-Oct-2010 22:09:12 +0100]: S: thrd1 NO Unknown argument ROUNDCUBE
[21-Oct-2010 22:09:12 +0100]: C: I LOGOUT

This is using Dovecot 1:1.0.15-2.3+lenny1 on Debian lenny (the stock Debian version, not a custom package). The most recent message in my inbox has subject "Re: Roundcube", so something should definitely be coming up!

comment:10 Changed 3 years ago by alec

  • Resolution set to wontfix
  • Status changed from reopened to closed
C: thrd1 THREAD REFERENCES UTF-8 ALL OR HEADER ENTIRE MESSAGE {9}

Here's the bug, but Roundcube doesn't uses "ENTIRE MESSAGE", so this must be from some plugin.

comment:11 Changed 3 years ago by alec

The reason could be also wrong 'search_mods' setting.

comment:12 Changed 3 years ago by kitserve

I found out the cause of the problem but am not sure how to fix it. At the moment the problem persists with

$rcmail_config['plugins'] = array();
$rcmail_config['search_mods'] = array();

While doing the install I tried tinkering with search_mods. My users had been requesting search to default to the entire message (as it does in e.g. Gmail), so I tried setting

$rcmail_config['search_mods'] = array('*' => array('Entire message' => 1));

This didn't work so I disabled it. However, looking at the MySQL users table it seems that Roundcube has stored this in the preferences for this user account, and there doesn't seem to be a way of removing it short of modifying the MySQL data directly - naturally I have tried ticking/unticking various boxes in the search options interface, but it doesn't help.

Is there any way of removing this setting short of messing with MySQL directly?

How would I configure search_mods to default to "Entire message"?

Finally, I noticed on a different account that by default all search boxes are unticked, but searching searches by Subject. Once a box has been ticked it is remembered across logins, which presumably is the new feature that has got confused with my original account. Surely the Subject box should be ticked though, or else search shouldn't return any results? I appreciate that's a little less user friendly for those that don't look at the options list, but it would be more logical...

comment:13 Changed 3 years ago by alec

You should use 'text' instead of 'Entire message'. You can fix this probably with SQL query like this:

UPDATE users SET preferences = REPLACE(preferences, 's:14:"Entire message";', 's:4:"text";');

I'll add some hints in config and checks in the code to prevent this.

Note: See TracTickets for help on using tickets.