Welcome to WebmasterWorld Guest from 54.226.194.180

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Email piping not working

     

Sub_Seven

2:07 am on Jan 10, 2013 (gmt 0)

5+ Year Member



Hello all,

It has been a while since I don't find myself in such desperate need of help.

I am trying to pipe email to a php script and I have tried so many different things from articles and tutorials and I keep getting bounced back.

So it seems a small bit of code could do most handling and at the very least not get bounced and this is my script:

#!/usr/bin/php -q
<?php

$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)){
$email .= fread($fd, 1024);
}
fclose($fd);


In my cPanel (from hostgator (in case is important)) I've added a forwarder to the email address in question like so:

|/home/username/public_html/pipe/script.php

Isn't this enough for it to work?

How do I make sure #!/usr/bin/php -q is the right path to my php? What should I look for in a php info file (phpinfo();)?

Hope this is enough to get someone to help me, thanks in advanced for any help provided.

Sub_Seven

6:54 pm on Jan 11, 2013 (gmt 0)

5+ Year Member



Could someone please help me here?

Sub_Seven

6:55 pm on Jan 11, 2013 (gmt 0)

5+ Year Member



... sorry, double post.

brotherhood of LAN

6:56 pm on Jan 11, 2013 (gmt 0)

WebmasterWorld Administrator brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Have you tried looking at the logging of your e-mail server, to see if it's receiving mail to handle?

Sub_Seven

9:13 pm on Jan 15, 2013 (gmt 0)

5+ Year Member



Can't say I have, I'm on cPanel, would you mind telling me where should I look for this?

Thanks for the help :)

brotherhood of LAN

9:27 pm on Jan 15, 2013 (gmt 0)

WebmasterWorld Administrator brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The /var/log/ folder if you're on a virtual/dedicated setup.

Alternatively try SSHing in and trying php from the command line using the -a flag and try mailing that way. Hopefully if you get an error message it can lead you further along to the answer.

Also try altering your script to have a line like touch('/createafile/here.txt'); ... then at least you can see that the script is being invoked.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month