Reply
Reading from stdin problem.
Old 11-21-2007, 07:52 PM Reading from stdin problem.
Junior Talker

Posts: 3
Hi!

I setup an email (redirect@domain.com) that all messages received will be redirected to my script for management, its kind of a management of bounced emails then I used the following code to get the email:

// Read
$fd = fopen("php://stdin", "r");
$email = "";

while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);


and I store the $email to the database. When I tried to directly send a message to (redirect@domain.com), it works as expected but when I purposely send a message to an invalid email with the return path is (redirect@domain.com) it didn't store the $email to my database. What went wrong with my code? Please help.
jeboy25 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 11-21-2007, 08:31 PM Re: Reading from stdin problem.
tripy's Avatar
Fetchez la vache!

Posts: 1,989
Name: Thierry
Location: In the void
Try already to log the connection made to your script.
Maybe the mailing redirection don't work, and as you work totally blind here, you will need it.
The error_log() function is what you can use, but set the destination log file first, with an ini_set();

Try to set an error_reporting to E_ALL, to see every warning, notices or else in your log.

PHP Code:
ini_set('log_file','php.log');
ini_set('display_errors',false);
ini_set('log_errors',true);
ini_set('display_errors',false);
error_reporting(E_ALL); 
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Reading from stdin problem.
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11107 seconds with 13 queries