Re: [PHP] Re: Using php as a backend bridge between smtp and mysql

2002-03-05 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> I got the sendmail part to work, but how do you process a pipe? I just need
> the variable name of yyy in "echo yyy | proc-mail.php"
> 
> On 3/4/02 5:05 PM, "David Robley" <[EMAIL PROTECTED]> wrote:
> 
> > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> >> Hi, 
> >> I need to have php called from sendmail. I have set up an address to be
> >> aliased to "|/usr/local/bin/proc-mail" but I get an error saying "service
> >> unavailable". All permissions correct. See php code below. This is just a
> >> test mechanism, right now, to send the email to a mysql database for a
> >> free-webmail system.
> >> 
> >> #!/usr/local/bin/php -q
> >>  >> $db_name = "mail";
> >> $table_name = "Messages";
> >> $connection = @mysql_pconnect("mysql.tossell.net","mail","fhsdbfhksdbfhjsd")
> >> or die("Couldn't connect.");
> >> $db = @mysql_select_db($db_name, $connection) or die("Couldn't select
> >> database."); 
> >> $sql = "insert into $table_name (rcpt, send, subject) VALUES
> >> ('ken','[EMAIL PROTECTED]','SUP?')";
> >> mysql_select_db( $db_name, $connection );
> >> mysql_query($sql);
> >> ?> 
> >> 
> >> Thanks.
> > 
> > Presumably that script is /usr/local/bin/proc-mail and that is the
> > complete script? If so, given that it takes no 'external' information,
> > what happens when you try and run it from the shell? Is it executable by
> > the appropriate level of user?
> 
> 
> 
I think you need to fopen php://stdin to get the arguments passed either 
via command line or pipe.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Using php as a backend bridge between smtp and mysql

2002-03-04 Thread Ken Tossell

I got the sendmail part to work, but how do you process a pipe? I just need
the variable name of yyy in "echo yyy | proc-mail.php"

On 3/4/02 5:05 PM, "David Robley" <[EMAIL PROTECTED]> wrote:

> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
>> Hi, 
>> I need to have php called from sendmail. I have set up an address to be
>> aliased to "|/usr/local/bin/proc-mail" but I get an error saying "service
>> unavailable". All permissions correct. See php code below. This is just a
>> test mechanism, right now, to send the email to a mysql database for a
>> free-webmail system.
>> 
>> #!/usr/local/bin/php -q
>> > $db_name = "mail";
>> $table_name = "Messages";
>> $connection = @mysql_pconnect("mysql.tossell.net","mail","fhsdbfhksdbfhjsd")
>> or die("Couldn't connect.");
>> $db = @mysql_select_db($db_name, $connection) or die("Couldn't select
>> database."); 
>> $sql = "insert into $table_name (rcpt, send, subject) VALUES
>> ('ken','[EMAIL PROTECTED]','SUP?')";
>> mysql_select_db( $db_name, $connection );
>> mysql_query($sql);
>> ?> 
>> 
>> Thanks.
> 
> Presumably that script is /usr/local/bin/proc-mail and that is the
> complete script? If so, given that it takes no 'external' information,
> what happens when you try and run it from the shell? Is it executable by
> the appropriate level of user?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php