[Tickets #1368] NEW: header and searchMailbox bug (lib/Horde/IMAP/Search.php)

bugs at bugs.horde.org bugs at bugs.horde.org
Sun Feb 13 14:06:50 PST 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=1368
-----------------------------------------------------------------------
 Ticket             | 1368
 Created By         | chris at huyler.net
 Summary            | header and searchMailbox bug (lib/Horde/IMAP/Search.php)
 Queue              | Horde Base
 Version            | 3.0.2
 State              | Unconfirmed
 Priority           | 2. Medium
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


chris at huyler.net (2005-02-13 14:06) wrote:

I am trying to make a filter rule in ingo that is producing buggy results. 
The logic in ingo looks correct but, searchMailbox is not returning the
correct result.

My rule: Match all of the following, Self defined header 'X-Virus-Scanned',
Doesn't contain 'huyler.net', deliver to Junk. This rule will bring you into
line 227 of ingo/lib/Script/imap.php:

line 227: $ob->header($val['field'], $val['value'], true);
line 230: $search_array[] = &$ob;
line 234: $query->imapAnd($search_array);
line 239: $indices = $imap_search->searchMailbox($query, $params['imap'],
$params['mailbox']);

Because 'X-Virus-Scanned' is not a standard header, the header function
(line 448 of lib/Horde/IMAP/Search.php) will set _extendedSearch instead of
_query.  On line 497, $_not is set correctly.  However, when we call
searchMailbox, the build function (line 406 of Search.php) sets 'not' to
false because _query is empty.  

The result: the 'not' flag does not work for non-standard headers.  

As a test, I commented out line 418.  This did not completely solve the
problem.  It then returns all messages that have 'X-Virus-Scanned' but the
header does not match my search string.  Messages that do not have the
header at all should also be returned.




More information about the bugs mailing list