[imp] IMP and filters

Peter Solodov peter at alcor.concordia.ca
Mon Jul 14 13:04:31 PDT 2003


On Mon, 14 Jul 2003, Chuck Hagenbuch wrote:
> Quoting Peter Solodov <peter at alcor.concordia.ca>:
> 
>> And I've just tested a simple fix for the search and indeed AND
>> worked properly...
> 
> And that fix was... ?

--- IMP.php.original    2003-02-12 18:08:32.000000000 -0500
+++ IMP.php     2003-07-14 15:19:09.000000000 -0400
@@ -1188,8 +1188,11 @@
             $baseQuery = 'UNDELETED ';
             $applied = array();
             for ($i = 0; $i < count($filters); $i++) {
+                $query = $baseQuery;
                 for ($j = 0; $j < count($filters[$i]['fields']); $j++) {
-                    $query = $baseQuery . strtoupper($filters[$i]['fields'][$j]) . ' "' . $filters[$i]['text'] . '"';
+                    $query = $query . strtoupper($filters[$i]['fields'][$j]) . ' "' . $filters[$i]['text'] . '" ';
+                }
+                Horde::raiseMessage($query,HORDE_MESSAGE);
                     $indices = @imap_search($imp['stream'], $query, SE_UID);
                     if (isset($indices) && is_array($indices)) {
                         $indices = array_diff($indices, $applied);
@@ -1228,7 +1231,6 @@
                 }
             }
         }
-    }
 
     /**
      * Converts a string to the modified UTF-7 charset as per

IMP is 3.2.1, IMAP server is WU's imap-2002d.

        - Peter

-- 
Peter Solodov                    | Concordia University 
http://alcor.concordia.ca/~peter | Montreal, QC, Canada


More information about the imp mailing list