[horde] searchMailbox bug (lib/Horde/IMAP/Search.php)

Christopher Huyler chris at huyler.net
Sat Feb 12 16:19:23 PST 2005


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.  If I
comment out line 418 everything works.  Can someone please look into this?

--
Christopher Huyler
chris at huyler.net
home: (508)376-2605
cell: (508)380-2181
work: (508)628-8232




More information about the horde mailing list