How to enable Searching for Recipient in RoundCube Webmail client

r0undcube.jpgI'm a big fan of RoundCube, the open source imap webmail client. While still in beta and lacking some features, it's free, licensed under the GPL, easily customized look due to reliance on CSS for styling, works great for basic email and is definitely one of the sexiest webmail clients out there.

One issue that had been bugging me is that it wouldn't search for Recipient (To) by default. Only for Sender (From) or Subject.

The fix is actually very easy, thanks to the well organized and thoroughly commented PHP source files. Just add the following highlighted items to /path/to/roundcube/program/steps/mail/

// search in subject and sender by default
else {
$search = $IMAP->search($mbox, "HEADER SUBJECT", trim($str), $imap_charset);
$search2 = $IMAP->search($mbox, "HEADER FROM", trim($str), $imap_charset);
$search3 = $IMAP->search($mbox, "HEADER TO", trim($str), $imap_charset);
finish_search($mbox, array_unique(array_merge($search, $search2, $search3)));

That's it! Gotta love open source.

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).