I tried to make this with the php function imap_search, but it was very slow.
So i try to make a roundcube plugin which return a json when a url (action) from roundcube is called.
The code until now looks something like this:
$rcmail = rcmail::get_instance();
$rcmail->get_storage()->search('INBOX', 'FROM "'.$_GET['_q'].'"', RCMAIL_CHARSET);
$results = $rcmail->get_storage()->get_search_set();
$result_h = $rcmail->get_storage()->list_messages('INBOX', 1);
$count = $rcmail->get_storage()->count('INBOX', $rcmail->get_storage()->get_threading() ? 'THREADS' : 'ALL');
print_r($result_h);
The print returns the correct results i expect, an array with the emails sent by the address on the $_GET['_q'].
You think this is ok? My problem now is disable the template on the plugin, because i'm getting an error saying i didn't define any template for it.