I am using Roundcube RC1 on Linux using PHP 5.1.6.
Problem: When I perform a search in the SENT folder, the search never queries against the TO: field of the email. It only does the FROM: and SUBJECT: fields. This is not right.
I peeked at the code in /program/steps/mail/search.inc and it seems like the default search criteria (when a specific criteria is not specified, I guess) is to only search the SUBJECT and the FROM fields:
// search in subject and sender by default else { $subject = array("HEADER SUBJECT", "HEADER FROM"); $search = trim($str); }
This makes perfect sense when the folder is *not* the SENT folder, but hampers searching within the SENT folder itself.
I am not familiar enough with the Roundcube code, but I would think a fix would be to add an additional conditional such that if the folder being search is the SENT folder, change the default search criteria to search the TO: and not the FROM:.
Someone want to validate my analysis? Comment on my theory? Provide a patch? A snippet of code, per chance?
Thanks.
..Bruce
Mr. B. Vrieling wrote:
I am using Roundcube RC1 on Linux using PHP 5.1.6.
Problem: When I perform a search in the SENT folder, the search never queries against the TO: field of the email. It only does the FROM: and SUBJECT: fields. This is not right.
[...]
This makes perfect sense when the folder is *not* the SENT folder, but hampers searching within the SENT folder itself.
Yes, you're right. This could be improved.
I am not familiar enough with the Roundcube code, but I would think a fix would be to add an additional conditional such that if the folder being search is the SENT folder, change the default search criteria to search the TO: and not the FROM:.
Something like if ($mbox == $CONFIG['sent_mbox']) $subject = array("HEADER SUBJECT", "HEADER TO"); else ...
Someone want to validate my analysis? Comment on my theory? Provide a patch? A snippet of code, per chance?
However, you can explicitly search for FROM and TO headers by entering from:searchterm or to:searchterm
~Thomas
Thomas,
On Tue, 19 Jun 2007 16:40:29 +0200, Thomas Bruederli roundcube@gmail.com wrote:
Something like if ($mbox == $CONFIG['sent_mbox']) $subject = array("HEADER SUBJECT", "HEADER TO"); else ...
I implemented your changes, and they work great! They were as follows, in my "simulated diff" format. I assume my intensions are obvious.
else if (preg_match("/^body:/i", $str)) { list(,$srch) = explode(":", $str); $subject = "TEXT"; $search = trim($srch); } +else if ($mbox == $CONFIG['sent_mbox']) +{
+}
// search in subject and sender by default else { $subject = array("HEADER SUBJECT", "HEADER FROM"); $search = trim($str); }
Thanks Thomas!
..Bruce