procmail
[Top] [All Lists]

Re: Executing an external program from procmail

2003-01-02 11:24:50
At 15:51 2-1-2003, Jeff Borders wrote:
However, when I run it from procmail it doesn't get the input.

Hi Jeff,

I do the same with a php script called BouncedMail.php
The email data is transferred over STDIN.

In procmail I write:

| php -q $INTERFACEDIR/BouncedMail.php >> $LOGDIR/$CLIENTNAME/BouncedMail.log

(depending on the client I have defined the vars, the output of the script goes to a logfile).

In the scrip I read the email from STDIN with:

## Read email from stdin
$fp = fopen ( "php://stdin", "r");
while (!feof ($fp))
{
    $content .= fgets($fp, 256);
}
fclose ($fp);

That's all.

cheers,

Peter Fekkes.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>