[imp] Fwd: IMP and Filtering Question
Chuck Hagenbuch
chuck at horde.org
Fri Dec 20 17:06:18 PST 2002
----- Forwarded message from arafuse@equat.com -----
Date: Fri, 20 Dec 2002 13:53:23 -0800
From: Allan Rafuse <arafuse@equat.com>
Reply-To: Allan Rafuse <arafuse@equat.com>
Subject: IMP and Filtering Question
To: "chuck@horde.org" <chuck@horde.org>
I was playing around IMP to try and make do filtering on user-specified headers.
I modifed the mailbox.php code with the following code below (and adding
'header' to $filtersLabel/$fieldsList in filters.php). I ran into a minor
glitch with
the php imap_search, as it only uses IMAP2 search capabilities.
Is there any way to modify the php (4.2.2)
/usr/src/php-4.2.2/ext/imap/php_imap.c imap_search function to use IMAP4
support?
C-Client: imap-2002.RC8
IMP: 3.1RC-3
Thanks in advance,
-Allan Rafuse
// Example Header Filter Value would be:
// Return-path:thall
// Return-path: thall
// Received: mail.server.com
mailbox.php:321
// arafuse
$field = strtoupper($filters[$i]['fields'][$j]);
$value = $filters[$i]['text'];
if ($field == "HEADER") {
$headerfield = trim(strtoupper(substr($value, 0,
strpos($value, ":"))));
$headervalue = trim(substr($value, strpos($value,
":") + 1));
print "HEADERFIELD: ". $headerfield. "<BR>";
print "HEADERVALUE: ". $headervalue. "<BR>";
$query = $baseQuery. "$field $headerfield". ' "'.
$headervalue. '"';
} else {
$query = $baseQuery .
strtoupper($filters[$i]['fields'][$j]) . ' "' . $filters[$i]['text'] . '"';
}
// end arafuse
print "QUERY: ". $query."<BR>";
<- Allan Rafuse ->
Systems Administrator
Equat.com Technologies
email: arafuse@equat.com
web: http://www.equat.com
----- End forwarded message -----
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
"People ask me all the time what it will be like living without otters."
- Google, thanks to Harpers
More information about the imp
mailing list