I'm writing a command line script to go through a mailbox on the file
system.  PHP the binary is compiled with imap, I've confirmed by using
imap_headers to get the array of the 10,051 messages and printed the array

Here's my code:

    #!/usr/local/bin/php -q

    $id = $_SERVER["argv"][1];


    list($usec, $sec) = explode(" ",microtime());
    $start = ((float)$usec + (float)$sec);

    $mbox = imap_open("/home/beckman/public_html/spamtracker/a-copy-of-spam", "", "") 
or die("can't open");

    print "Finding '$id' (Executing imap_search($mbox,'$id'))\n";
    $matches = imap_search($mbox, '$id');

    #while(list($key,$val)=each($matches)) {
    #   echo "$key: $val\n";


Here's what I get when searching for a variety of different possibilities (no results 
being returned in $matches):

Finding 'ALL fat' (Executing imap_search(Resource id #1,'ALL fat'))
Finding 'ALL "fat"' (Executing imap_search(Resource id #1,'ALL "fat"'))
Finding 'BODY "fat"' (Executing imap_search(Resource id #1,'BODY "fat"'))

Then I put SE_UID as the last option in imap_search:
Finding 'BODY "fat"' (Executing imap_search(Resource id #1,'BODY "fat"',SE_UID))
Finding 'TO "[EMAIL PROTECTED]"' (Executing imap_search(Resource id #1,'TO 

I get nothing in $matches ever.  What is going on?  Am I doing it wrong?
I've read the documentation and the contributed notes and copied and pasted
replacing the search strings and continue to fail.  Argh.

I know the word "fat" is in the body of more than 50 messages, as well as
in the headers, as there are 10,051 pieces of spam I'm trying to parse.

Peter Beckman                                                  Internet Guy
[EMAIL PROTECTED]                             http://www.purplecow.com/

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to