"Will Paris" <wi***********@sbcglobal.net> wrote in message
news:3y**********************@newssvr28.news.prodi gy.com...
How can a POP3 email address execute a script?
Someone sends an email to so**************@mydomain.com and that email
parses subject and message and sender and executes somePHPfunctions() in a
script(possibly in somePHPfunctions.php). Is this a cron issue or an
apache issue? Curious as to if it can be done.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/04
Do this: (i know guys, there are other ways to do it with procmailrc, but
most people mess that file up)
in /etc/mail/virtusertable:
so*******@somedomain.com aliasScriptName
then in /etc/alaises
aliasScriptName "| /etc/smrsh/scriptname"
then in /etc/smrsh/scriptname
#!/usr/bin/php -q
<?php
// read from stdin
$fd = fopen("php://stdin", "r");
while (!feof($fd))
{
$inData = fgets($fd, 1024);
$inData = trim($inData);
.. proccess $inData here ...
}
fclose($fd);
?>
--
Mike Bradley
http://www.gzentools.com -- free online php tools