Summary | header and searchMailbox bug (lib/Horde/IMAP/Search.php) |
Queue | Ingo |
Queue Version | 1.0.1 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | slusarz (at) horde (dot) org |
Requester | chris (at) huyler (dot) net |
Created | 02/13/2005 (7459 days ago) |
Due | |
Updated | 02/17/2005 (7455 days ago) |
Assigned | 02/16/2005 (7456 days ago) |
Resolved | 02/17/2005 (7455 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
State ⇒ Feedback
http://cvs.horde.org/diff.php/framework/IMAP/IMAP/Search.php?r1=1.31&r2=1.32&ty=u
State ⇒ Assigned
Version ⇒ 1.0.1
State ⇒ Feedback
Queue ⇒ Ingo
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ header and searchMailbox bug (lib/Horde/IMAP/Search.php)
Queue ⇒ Horde Base
State ⇒ Unconfirmed
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.