Hello everyone my name is Chris and I have just subscribed to ask a question

Currently running Redhat 7.2, php4.0.6.7, apache 1.3.22-2, mysql3.23.41-1

Now I have a script that runs every 10 mins in the crontab, 
that checks to see if a file size is 0 or bigger.. if it is bigger then 
it mails me, heres a copy 

#!/usr/bin/php -q


$check = system("cat /var/spool/mail/user_mailbox > result");

$fs = filesize(result);

if ($fs > 0){

$jobfood_list = "email.txt";
$emails = file($list);

        for ($i=0; $i < count($emails); $i++) $emails[$i] =
                $recipient = implode(",", $emails);

        $mail_subject="mail notification";
        $mail_body="The users mailbox has mail.\n\n";
        mail($recipient, $mail_subject, $mail_body);
        print "mail sent";

Right now your in the picture this is okay to check if the mailbox is above
the size of 0. But what I really need help with is, say for instance I get 1
message into the mailbox and the script runs, I only want it to run once for
that message, however if another message comes in I need it to notify me...
at the moment it runs every 10 mins and just keeps notifying me over & over.

Any Help would be cool ...please !!!



Chris Grigor
Client Services
Call Center: 0860 100 154
Fax: +27 11 340 7345
M-WEB Business Solutions
Making it happen.

Go shopping @ http://shopping.mweb.co.za 
Get your business online @ http://business.mweb.com 

"We all know Linux is great...it does infinite loops in 5 seconds."
- Linus Torvalds

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to