Re: Mayor problems with .qmail!

2001-02-11 Thread Halfdan Mouritzen



Vince Vielhaber wrote:
 
 On Sat, 10 Feb 2001, Chris Johnson wrote:
 
  On Sun, Feb 11, 2001 at 04:57:14AM +0100, Halfdan Mouritzen wrote:
   In the .qmail-robot file I've written
  
   |usr/hotel/topdog/WWW/temp/qmailtest.php
 
  Can you just go piping things into a php script and expect your PHP interpreter
  to spring into action to interpret the script for you? Isn't there supposed to
  be a web server involved somewhere? (Maybe you can do this, but it would come
  as a surprise to me.) What happens if you pipe the data into the script
  directly, without involving qmail?

Since PHP is built as an Apache module I recon that it gets
invoked even when I call the script from commend line.
(I can do it anyway)

 
 You can build PHP for command line use, but even from the command line
 the first thing it does is prints some html headers.  I never found a
 way to shut that off, but I also didn't try that hard.  I guess you can
 grep them out but the end result is why bother?
 
The first line of the file reads
# !/usr/local/bin/php -q

This ofcourse tells the server where to find the PHP
interpreter and the '-q' tells it to shut up, 
that it shouldn't output anything to stdout.

Anyway a PHP doesn't output anything if you don't use any
output functions (echo, print, header functions)

// Halfdan


 Vince.
 --
 ==
 Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
  128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
 Online Campground Directoryhttp://www.camping-usa.com
Online Giftshop Superstorehttp://www.cloudninegifts.com
 ==




Re: Mayor problems with .qmail!

2001-02-11 Thread Vince Vielhaber

On Sun, 11 Feb 2001, Halfdan Mouritzen wrote:



 Vince Vielhaber wrote:
  You can build PHP for command line use, but even from the command line
  the first thing it does is prints some html headers.  I never found a
  way to shut that off, but I also didn't try that hard.  I guess you can
  grep them out but the end result is why bother?
 
 The first line of the file reads
 # !/usr/local/bin/php -q

 This ofcourse tells the server where to find the PHP
 interpreter and the '-q' tells it to shut up,
 that it shouldn't output anything to stdout.

 Anyway a PHP doesn't output anything if you don't use any
 output functions (echo, print, header functions)

Interesting.  And useful.  Learn something new, etc.  I just tried
this out and not only does it work as described, I think I just found
a replacement for straight perl (I'm much more comfortable with PHP
than perl).

I also just tried some simple stdin stuff with it and it does what it
should.   So I'd have to ask what exactly you're doing, what exactly
is happening and what were you expecting to happen?

Vince.
-- 
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
 128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
Online Campground Directoryhttp://www.camping-usa.com
   Online Giftshop Superstorehttp://www.cloudninegifts.com
==








Re: Mayor problems with .qmail!

2001-02-11 Thread Sean C Truman

Just so you know.. this will disable the HTML output (Unless ofcourse its a
PHP warning or Error).

#!/usr/local/bin/php -q


Sean
- Original Message -
From: "Vince Vielhaber" [EMAIL PROTECTED]
To: "Chris Johnson" [EMAIL PROTECTED]
Cc: "Halfdan Mouritzen" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, February 10, 2001 10:55 PM
Subject: Re: Mayor problems with .qmail!


 On Sat, 10 Feb 2001, Chris Johnson wrote:

  On Sun, Feb 11, 2001 at 04:57:14AM +0100, Halfdan Mouritzen wrote:
   In the .qmail-robot file I've written
  
   |usr/hotel/topdog/WWW/temp/qmailtest.php
 
  Can you just go piping things into a php script and expect your PHP
interpreter
  to spring into action to interpret the script for you? Isn't there
supposed to
  be a web server involved somewhere? (Maybe you can do this, but it would
come
  as a surprise to me.) What happens if you pipe the data into the script
  directly, without involving qmail?

 You can build PHP for command line use, but even from the command line
 the first thing it does is prints some html headers.  I never found a
 way to shut that off, but I also didn't try that hard.  I guess you can
 grep them out but the end result is why bother?

 Vince.
 --
 ==
 Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
  128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
 Online Campground Directoryhttp://www.camping-usa.com
Online Giftshop Superstorehttp://www.cloudninegifts.com
 ==








Re: Mayor problems with .qmail!

2001-02-11 Thread Vince Vielhaber

On Sun, 11 Feb 2001, Sean C Truman wrote:

 Just so you know.. this will disable the HTML output (Unless ofcourse its a
 PHP warning or Error).

 #!/usr/local/bin/php -q

Yes, but in this case I believe it's desirable to turn the html off.

Vince.
-- 
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
 128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
Online Campground Directoryhttp://www.camping-usa.com
   Online Giftshop Superstorehttp://www.cloudninegifts.com
==






Re: Mayor problems with .qmail!

2001-02-11 Thread Sean C Truman

They asked if there was a command to turn off the html output produced (I
believe he is talking about the header information that php sends) -q will
accomplish this..

Sean

- Original Message -
From: "Vince Vielhaber" [EMAIL PROTECTED]
To: "Sean C Truman" [EMAIL PROTECTED]
Cc: "Chris Johnson" [EMAIL PROTECTED]; "Halfdan Mouritzen"
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 12:55 PM
Subject: Re: Mayor problems with .qmail!


 On Sun, 11 Feb 2001, Sean C Truman wrote:

  Just so you know.. this will disable the HTML output (Unless ofcourse
its a
  PHP warning or Error).
 
  #!/usr/local/bin/php -q

 Yes, but in this case I believe it's desirable to turn the html off.

 Vince.
 --
 ==
 Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
  128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
 Online Campground Directoryhttp://www.camping-usa.com
Online Giftshop Superstorehttp://www.cloudninegifts.com
 ==








Re: Mayor problems with .qmail!

2001-02-11 Thread Halfdan Mouritzen



Vince Vielhaber wrote:
 
 On Sun, 11 Feb 2001, Sean C Truman wrote:
 
  Just so you know.. this will disable the HTML output (Unless ofcourse its a
  PHP warning or Error).
 
  #!/usr/local/bin/php -q
 
 Yes, but in this case I believe it's desirable to turn the html off.
It certainly is.
If any HTML is output from the script, the shell will
terminate the script.
(Thats why I couldn't make my cron jobs work for a little while...)

// Halfdan

 
 Vince.
 --
 ==
 Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
  128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
 Online Campground Directoryhttp://www.camping-usa.com
Online Giftshop Superstorehttp://www.cloudninegifts.com
 ==

-- 
//
Halfdan Mouritzen
Director of multimedia design
[EMAIL PROTECTED]
http://www.topdog.dk
//



Re: Mayor problems with .qmail!

2001-02-11 Thread Sean C Truman

If your PHP is sending errors or warnings then there is something wrong with
the code. If properly written NO HTML will be shown with the -q flag.

Sean

- Original Message -
From: "Halfdan Mouritzen" [EMAIL PROTECTED]
To: "Vince Vielhaber" [EMAIL PROTECTED]
Cc: "Sean C Truman" [EMAIL PROTECTED]; "Chris Johnson"
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 1:02 PM
Subject: Re: Mayor problems with .qmail!




 Vince Vielhaber wrote:
 
  On Sun, 11 Feb 2001, Sean C Truman wrote:
 
   Just so you know.. this will disable the HTML output (Unless ofcourse
its a
   PHP warning or Error).
  
   #!/usr/local/bin/php -q
 
  Yes, but in this case I believe it's desirable to turn the html off.
 It certainly is.
 If any HTML is output from the script, the shell will
 terminate the script.
 (Thats why I couldn't make my cron jobs work for a little while...)

 // Halfdan

 
  Vince.
  --
 
==
  Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]
http://www.pop4.net
   128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
  Online Campground Directoryhttp://www.camping-usa.com
 Online Giftshop Superstorehttp://www.cloudninegifts.com
 
==

 --
 //
 Halfdan Mouritzen
 Director of multimedia design
 [EMAIL PROTECTED]
 http://www.topdog.dk
 //





Re: Mayor problems with .qmail!

2001-02-11 Thread Halfdan Mouritzen

If proplerly written, no html will be shown even without the
-q flag.
At the same time you can use @ infront of any error returning functions
(like calling a database which could be unavaliable) 
The @ turns of error messages.

// Halfdan

Sean C Truman wrote:
 
 If your PHP is sending errors or warnings then there is something wrong with
 the code. If properly written NO HTML will be shown with the -q flag.
 
 Sean
 
 - Original Message -
 From: "Halfdan Mouritzen" [EMAIL PROTECTED]
 To: "Vince Vielhaber" [EMAIL PROTECTED]
 Cc: "Sean C Truman" [EMAIL PROTECTED]; "Chris Johnson"
 [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, February 11, 2001 1:02 PM
 Subject: Re: Mayor problems with .qmail!
 
 
 
  Vince Vielhaber wrote:
  
   On Sun, 11 Feb 2001, Sean C Truman wrote:
  
Just so you know.. this will disable the HTML output (Unless ofcourse
 its a
PHP warning or Error).
   
#!/usr/local/bin/php -q
  
   Yes, but in this case I believe it's desirable to turn the html off.
  It certainly is.
  If any HTML is output from the script, the shell will
  terminate the script.
  (Thats why I couldn't make my cron jobs work for a little while...)
 
  // Halfdan
 
  
   Vince.
   --
  
 ==
   Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]
 http://www.pop4.net
128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
   Online Campground Directoryhttp://www.camping-usa.com
  Online Giftshop Superstorehttp://www.cloudninegifts.com
  
 ==
 
  --
  //
  Halfdan Mouritzen
  Director of multimedia design
  [EMAIL PROTECTED]
  http://www.topdog.dk
  //
 

-- 
//
Halfdan Mouritzen
Director of multimedia design
[EMAIL PROTECTED]
http://www.topdog.dk
//



Re: Mayor problems with .qmail!

2001-02-11 Thread Johan Almqvist

* Halfdan Mouritzen [EMAIL PROTECTED] [010211 04:57]:
In the .qmail-robot file I've written
|usr/hotel/topdog/WWW/temp/qmailtest.php

Apart from all the other (half-useful) discussion, isn't there a / missing
between | and usr/  ?

-Johan
-- 
Johan Almqvist
http://www.almqvist.net/johan/qmail/

 PGP signature


Re: Mayor problems with .qmail!

2001-02-10 Thread Chris Johnson

On Sun, Feb 11, 2001 at 04:57:14AM +0100, Halfdan Mouritzen wrote:
 The thing is I've got a .qmail file which is supposed to recieve
 email, send it to a php script which fiddles around with it
 and sends an answer back to the sender.
 
 So,
 The mail address is [EMAIL PROTECTED]
 I've got a file called ".qmail-robot" in my home dir
 "usr/hotel/topdog/"
 and a php file called "qmailtest.php " in usr/hotel/topdog/WWW/temp/
 
 In the .qmail-robot file I've written
 
 |usr/hotel/topdog/WWW/temp/qmailtest.php

Can you just go piping things into a php script and expect your PHP interpreter
to spring into action to interpret the script for you? Isn't there supposed to
be a web server involved somewhere? (Maybe you can do this, but it would come
as a surprise to me.) What happens if you pipe the data into the script
directly, without involving qmail?

 The .qmail files chmod is 400, since it says in the qmail faq that it
 cant be group or world writable and it cant be executable if
 it contains program lines.
 
 The qmailtest.php chmod is 777.
 
 This looks right to me
 BUT IT'S NOT WORKING!!!

Come on. Are you going to make us pull teeth? Define "NOT WORKING." What did
you expect to happen? What did happen? What do the logs say?

And please don't post HTML.

Chris

 PGP signature


Re: Mayor problems with .qmail!

2001-02-10 Thread Vince Vielhaber

On Sat, 10 Feb 2001, Chris Johnson wrote:

 On Sun, Feb 11, 2001 at 04:57:14AM +0100, Halfdan Mouritzen wrote:
  In the .qmail-robot file I've written
 
  |usr/hotel/topdog/WWW/temp/qmailtest.php

 Can you just go piping things into a php script and expect your PHP interpreter
 to spring into action to interpret the script for you? Isn't there supposed to
 be a web server involved somewhere? (Maybe you can do this, but it would come
 as a surprise to me.) What happens if you pipe the data into the script
 directly, without involving qmail?

You can build PHP for command line use, but even from the command line
the first thing it does is prints some html headers.  I never found a
way to shut that off, but I also didn't try that hard.  I guess you can
grep them out but the end result is why bother?

Vince.
-- 
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
 128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
Online Campground Directoryhttp://www.camping-usa.com
   Online Giftshop Superstorehttp://www.cloudninegifts.com
==






Re: Mayor problems with .qmail!

2001-02-10 Thread sberg

Is this too simple of a solution?

Wouldn't you need to send the mail to [EMAIL PROTECTED]  Then qmail
will deliver it to your user account and then see the .qmail-robot file
and act accordingly.


On Sun, 11 Feb 2001, Halfdan Mouritzen wrote:

 Hi everyone,
 
 I've spent at least three weeks trying to make this stupid stunt work!
 
 The thing is I've got a .qmail file which is supposed to recieve email,
 send it to a php script which fiddles around with it
 and sends an answer back to the sender.
 
 So,
 The mail address is [EMAIL PROTECTED]
 I've got a file called ".qmail-robot" in my home dir "usr/hotel/topdog/"
 and a php file called "qmailtest.php " in usr/hotel/topdog/WWW/temp/
 
 In the .qmail-robot file I've written
 
 |usr/hotel/topdog/WWW/temp/qmailtest.php
 
 The .qmail files chmod is 400, since it says in the qmail faq that it
 cant be group or world writable and it cant be executable if
 it contains program lines.
 
 The qmailtest.php chmod is 777.
 
 This looks right to me
 BUT IT'S NOT WORKING!!!
 
 :(
 
 Can someone please help me?
 I would aprciate the help so so much, since I really don't know what to
 do, I've tried everything!
  
 
 BTW this is the system stuff :
 GNU bash, version 2.03.0(1)-release (i386--freebsd3.4)