[imp] Fwd: IMP and Filtering Question

Michael M Slusarz slusarz at bigworm.colorado.edu
Mon Dec 23 17:26:25 PST 2002


Quoting Chuck Hagenbuch <chuck@horde.org>:

| ----- 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>";
|
| ----- End forwarded message -----

Bug the PHP developers.  The current imap_search() function does not 
support AND searches either (even though the underlying c-client does).  I 
think I'll open up a bug report this time and see if that gets anything 
accomplished.

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder


More information about the imp mailing list