6.0.0-beta1
7/17/25

[#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 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

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