Click to See Complete Forum and Search --> : Piping emails episode II - the revenge of the mail server


piersk
10-09-2004, 02:16 PM
<geek joke>
Hmmm... maybe that should be episode III
</geek joke>

Anyway, I posted a while back in the general forums about piping emails to a PHP script. I'm using CPanel and have set the email to forward to " |/home/piersk/public_html/test.php"

All that is in test.php is the micro-script that AstroTeg suggested. However, I keep getting a bounce back (see attachment to see the text).

What am I doing wrong? Can anyone help?

Norman Graham
11-04-2004, 08:43 AM
Hi Piersk

Your message is almost a month old now, and perhaps you've already solved it, but I just read the text of the bounce message and it seems to me your script is trying literally to deliver to the address 'pipe to |/home/piersk/public_html/test.php' - that's what the message seems to suggest. This smells of a syntax/logic error somewhere in your code - an oversight more than anything else.

HTH

Norm

piersk
11-04-2004, 12:54 PM
No I haven't fixed this yet.

I use CPanel to control the forwarding of emails etc etc. Do you think that it might be worth forwarding the emails to /home/piersk/public_html/test.php rather than |/home/piersk/public_html/test.php

Norman Graham
11-05-2004, 04:31 AM
Hi Piersk

What I'm saying is that your script seems to believe that the e-mail address is LITERALLY:

'pipe to |/home/piersk/public_html/test.php'

That's what the error message indicates. Obviously this isn't an e-mail address, but rather a path. This leads me to believe that your code contains a syntax or logic error somewhere, such that the code is trying to interpret ...

'pipe to |/home/piersk/public_html/test.php'

... as a direct e-mail address.

Do you see what I mean?

HTH

Norm

piersk
11-14-2004, 07:50 AM
Apologies that I haven't replied for so long... been bogged down with coursework :glare:

Anywho... I'm still having problems with this. All I've done is set an email forwarder up (using CPanel) to forward any emails that come in to a certain email address and I'm (apparently) piping them to this script. However, it's not working.

I've tried forwarding the emails to the following:

/home/piersk/public_html/test.php - this caused cpanel to think that I wanted to forward the emails to that@mydomain.com... not what I'm looking for

|"/home/piersk/public_html/test.php" - got the mail delivery error again

|/home/piersk/public_html/test.php - got mail delivery error again

and of course "|/home/piersk/public_html/test.php" - and got the delivery error.

The problem that I have is that the emails aren't even getting to my script. They're just being bounced back

move3rd
11-14-2004, 09:02 AM
As Norman Graham said that is becouse cpanel is expecting an e-mail address and not a path. Every time it tries forward an e-mail to the address/path you provided it bounces becouse the path is not a valid e-mail address.

I'm sure there must be better ways to do this than using cpanel. I've used a gpl support ticketing system that does exactly waht you want but I carnt remember what it's called. There are solutions out there.

piersk
11-14-2004, 09:17 AM
Originally posted by move3rd
As Norman Graham said that is because cpanel is expecting an e-mail address and not a path. Every time it tries forward an e-mail to the address/path you provided it bounces becouse the path is not a valid e-mail address.

I'm sure there must be better ways to do this than using cpanel. I've used a gpl support ticketing system that does exactly waht you want but I carnt remember what it's called. There are solutions out there.

I use CPanel cos thats what I get with my hosting package. Apparently you should be able to do what I've said above.

move3rd
11-14-2004, 09:27 AM
Sorry, my misunderstanding...:queasy:

jpr
07-17-2005, 01:34 PM
I am having a similar problem. I have used cPanel to set up the email pipe. The email is successfully sent to the php file and executed. However the email is still bounced back then. I think there might be a way to modify the pipe command to first pipe it to the file and then send it to some catch-all mail address. Any thoughts on this anybody?

Jason