Re: Pipe an email to PHP

From: Date: Wed, 27 Aug 2003 00:06:58 +0000
Subject: Re: Pipe an email to PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-160860@lists.php.net to get a copy of this message
> > I'm sure this question has been visited before, but I've had some troubles > searching through > the archives. > > This is at least a two part question. > > I wish to use a pipe instead of the pop3 class, because I wish the email to > start the script > instead of waiting for a cronjob. > > 1) The pipe itself: > On a cPanel server, I wish to setup an email address with a pipe like: > script@mydomain.com <mailto:script@mydomain.com> : > |/home/account/public_html/mailtools/emailscript.php I would read the data from the pipe with STDIN: $fp = fopen("php://stdin", "r"); while(!feof($fp)) $buffer .= fgets($fp, 4096); fclose($fp); > This always gives me an error saying it cannot foraward. > > If I pipe it to "|/usr/bin/php > /home/account/public_html/mailtools/emailscript.php" > it tells me: "No input file specified." I use something like that in my .procmailrc: :0 fw | /usr/bin/spamassassin :0 * ^X-Spam-Status: Yes { :0 c | $HOME/.spamassassin/spamcop.php :0 spam } -- Greg Donald http://destiney.com/

« previous php.general (#160860) next »