procmail
[Top] [All Lists]

Re: procmail: Piping to a PHP script.

2010-08-07 20:47:51
On Sat, Aug 7, 2010 at 7:28 PM, Joel Lee <joel(_dot_)lee8(_at_)gmail(_dot_)com> 
wrote:
John-

1: Yes, I've set permissions to 777 on echo.php.

2: Absolutely.

On Sat, Aug 7, 2010 at 6:03 PM, John Simpson <john(_at_)swajime(_dot_)com> 
wrote:

On Sat, Aug 7, 2010 at 3:25 PM, Joel Lee 
<joel(_dot_)lee8(_at_)gmail(_dot_)com> wrote:
Thanks for the suggestions.  Unfortunately, this doesn't help.  When
commenting those lines out, it won't even run from the command line,
with
the interpreter specified in the file or with the interpreter specified
in
the command line.  It seems that php expects to find those lines.  When
it
doesn't, it just echos back the entire contents of the file as source
code.

Thanks again.

On Fri, Aug 6, 2010 at 8:29 PM, John Simpson <john(_at_)swajime(_dot_)com> 
wrote:

You need to comment out lines 2 and 4 of echo.php

My bad ...
That only worked because your test only had "echo" as a command, and
that is valid bash syntax.

john(_at_)desktop:~$ cat echo.rc
VERBOSE=yes
:0 fbw
|/home/john/echo.php

:0
|
john(_at_)desktop:~$ cat echo.php
#!/usr/bin/php
<?php
  echo "hi.";
  // your script
?>
john(_at_)desktop:~$ echo "hello" | procmail -pm echo.rc
procmail: [24955] Sat Aug  7 20:43:38 2010
procmail: Executing "/home/john/echo.php"
procmail: [24955] Sat Aug  7 20:43:38 2010
procmail: Assigning "LASTFOLDER=|"
hello
hi.
  Folder: |                                                                  10
john(_at_)desktop:~$

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail