[RCD] Help trying to do a search with only the framework.

Thomas Bruederli thomas at roundcube.net
Thu Apr 23 08:30:47 CEST 2015


On Mon, Apr 20, 2015 at 4:20 PM, Rodrigo Santellan <rsantellan at gmail.com> wrote:
> Thomas,
>
> Now the search is working, but is bringing all the mbox content not only the
> search. If I run per example 'delivery' on roundcube in my ISP I get 6
> result but on my search bring all the stuff.
>
> This is my search method:
>
>  public function search($folder, $criteria, $pager = 1, $quantity = 1000)
>   {
>     [... lots of PHP code ...]
>   }

I'm lacking time and interest in reading through all of your code.
However, I suspect you're passing just an empty string to the
rcube_imap::search() function at some point.

Enable IMAP debug logging (in Roundcube config set
$config['imap_debug'] = true; or with $storage->set_debug(true)) and
check what IMAP commands are actually sent to your IMAP server and
what's the reply from it. The entire IMAP communication is logged into
the 'imap' log file in your Roundcube logs directory.

If that doesn't help, please reduce your code to a simple test case
showing that the Roundcube framework doesn't work as expected.

Kind regards,
Thomas


> On Fri, Apr 17, 2015 at 5:00 AM, Thomas Bruederli <thomas at roundcube.net>
> wrote:
>>
>> On Tue, Apr 14, 2015 at 9:45 PM, Rodrigo Santellan <rsantellan at gmail.com>
>> wrote:
>> > Hi,
>>
>> Hello Rodrigo
>> >
>> > I'm trying to do a search with only the framework framework. I has been
>> > trying to separate the component so they can be used on another
>> > framework,
>> > I'm using it now in Symonfony2 but planing to use in another ones.
>> >
>> > So far I identified the class rcube_imap_search that will do the search.
>>
>> Please note that this class is only a helper class for internal use.
>> >
>> > I created a helper with static methods that I'm rewriting to not use
>> > globals.
>> >
>> >
>> > On the file RouncubeHelper I create a connection to the IMAP server. My
>> > problem is that when I try to do the actual search with the method
>> > search it
>> > always come empty.
>> >
>> > What I'm missing? If I'm using only one folder is a good practice to
>> > call
>> > to:
>> > $searchRcube = new \rcube_imap_search(array('skip_deleted' => true),
>> > $this->rcube->get_storage()->conn);
>> > $data = $searchRcube->exec(array($folder), $criteria, null, 'date');
>> >
>> > Like that?
>>
>> In order to execute a search (or any other IMAP operation), you should
>> use the methods of the rcube_imap instance you get via
>> rcube::get_storage(). For searching that would be rcube_imap::search()
>> [1]. See an example how to execute the search in the Roundcube webmail
>> code [2].
>>
>> Kind regards,
>> Thomas
>>
>>
>> [1]
>> https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_imap.php#L1513
>> [2]
>> https://github.com/roundcube/roundcubemail/blob/master/program/steps/mail/search.inc#L121
>> _______________________________________________
>> Roundcube Development discussion mailing list
>> dev at lists.roundcube.net
>> http://lists.roundcube.net/mailman/listinfo/dev
>
>
>
> _______________________________________________
> Roundcube Development discussion mailing list
> dev at lists.roundcube.net
> http://lists.roundcube.net/mailman/listinfo/dev


More information about the dev mailing list