[#1368] header and searchMailbox bug (lib/Horde/IMAP/Search.php)
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 2005-02-13 (5824 days ago)
Updated 2005-02-17 (5820 days ago)
Assigned 2005-02-16 (5821 days ago)
Resolved 2005-02-17 (5820 days ago)
Patch No

2005-02-17 04:45:40 Michael Slusarz Comment #7
State ⇒ Resolved
Reply to this comment
Merged to FRAMEWORK_3.
2005-02-17 04:35:47 chris (at) huyler (dot) net Comment #6 Reply to this comment
Yes it does.  Thank you.  This issue may be closed.
2005-02-16 06:02:19 Michael Slusarz Comment #5
State ⇒ Feedback
Reply to this comment
2005-02-14 13:29:08 Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
2005-02-14 13:11:44 chris (at) huyler (dot) net Comment #4 Reply to this comment
Yes.  I am using ingo v1.0.1 with horde v3.0.2.
2005-02-14 08:50:11 Jan Schneider Comment #3 Reply to this comment
Do you actually use the latest Ingo version?
2005-02-14 08:49:46 Jan Schneider Comment #2
Queue ⇒ Ingo
State ⇒ Feedback
Version ⇒ 1.0.1
Reply to this comment
Moved to correct queue
2005-02-13 22:06:49 chris (at) huyler (dot) net Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ header and searchMailbox bug (lib/Horde/IMAP/Search.php)
Queue ⇒ Horde Base
Reply to this comment
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.

Saved Queries