Fixed wrong sqimap_run_command call. The $sid is added inside
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 2 Jun 2003 21:19:53 +0000 (21:19 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 2 Jun 2003 21:19:53 +0000 (21:19 +0000)
sqimap_run_command!.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4964 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/filters/filters.php

index eea3e1c..1300394 100644 (file)
@@ -332,16 +332,15 @@ function spam_filters($imap_stream) {
            $read = sqimap_run_command($imap_stream, 'FETCH 1:* (FLAGS BODY.PEEK[HEADER.FIELDS ' .
             '(RECEIVED)])', true, $response, $message, $uid_support);
         } else {
-           $read[0] = trim($read[0]);
-            $i = 0;
-            $imap_query = $sid.' FETCH ';
-            $Chunks = explode(' ', $read[0]);
-            for ($i=2; $i < (count($Chunks)-1) ; $i++) {
-                $imap_query .= $Chunks[$i].',';
+            if (isset($read[0])) {
+                if (preg_match("/^\* SEARCH (.+)$/", $read[0], $regs)) {
+                    $search_array = preg_split("/ /", trim($regs[1]));
+                }
             }
-            $imap_query .= $Chunks[count($Chunks)-1];
+           $msgs_str = sqimap_message_list_squisher($search_array);
+            $imap_query = 'FETCH '.$msgs_str;
             $imap_query .= ' (FLAGS BODY.PEEK[HEADER.FIELDS ';
-            $imap_query .= '(RECEIVED)])';//\r\n";
+            $imap_query .= '(RECEIVED)])';
            $read = sqimap_run_command($imap_stream,$imap_query, true, $response, $message, $uid_support);
         }
     }