Re: [PHP] How to get incoming emails captured by PHP ?
Adrian wrote: I have my aliases file set up with the line: ade: |/usr/bin/php, |/wwwroot/www.domain.com/ade/email.php (The path to my PHP is correct) There should only be one | on that line. It should read... ade: /usr/bin/php /wwwroot/www.domain.com/ade/email.php And the script it calls (email.php) the code is: #!/usr/bin/php ?php $fd = fopen(php://stdin, r); $email = ; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); ? Hopefully you realise this script is just reading the email into $email and then not doing anything with it. Mail sent to this script will be lost, so here's hoping that's not the finished article. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get incoming emails captured by PHP ?
Adrian wrote: Hi All I have been trying to have PHP capture incoming emails sent to a specific email account and have not been able to achieve this, I have searched high and low on the internet and the same article (http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/index.html) is plastered everywhere I have done everything it says, and still no joy, When I send an email to be captured I receive this bounce back email when sending an email to [EMAIL PROTECTED] (see below) Can any one let a hand? Bounce back email: -- - The following addresses had permanent fatal errors - |/wwwroot/www.domain.com/ade/email.php (reason: 255) (expanded from: [EMAIL PROTECTED]) - Transcript of session follows - Status: 404 Content-type: text/html X-Powered-By: PHP/4.3.11 No input file specified. 554 5.3.0 unknown mailer error 255 Content-type: text/html X-Powered-By: PHP/4.3.11 -- Here is how I have everything setup. I have my aliases file set up with the line: ade: |/usr/bin/php, |/wwwroot/www.domain.com/ade/email.php Why are you passing it to the php binary? Pass it directly to your script (make sure it's executable). For shits and giggles, do a 'which php' at the command line to make sure the binary is in /usr/bin. (The path to my PHP is correct) And the script it calls (email.php) the code is: #!/usr/bin/php ?php $fd = fopen(php://stdin, r); There's also an easier way to do this. Check the manual: http://us2.php.net/manual/en/features.commandline.php $email = ; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); ? -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get incoming emails captured by PHP ?
Stut wrote: Adrian wrote: I have my aliases file set up with the line: ade: |/usr/bin/php, |/wwwroot/www.domain.com/ade/email.php (The path to my PHP is correct) There should only be one | on that line. It should read... ade: /usr/bin/php /wwwroot/www.domain.com/ade/email.php D'oh, meant... ade: |/usr/bin/php /wwwroot/www.domain.com/ade/email.php Soz. -Stut And the script it calls (email.php) the code is: #!/usr/bin/php ?php $fd = fopen(php://stdin, r); $email = ; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); ? Hopefully you realise this script is just reading the email into $email and then not doing anything with it. Mail sent to this script will be lost, so here's hoping that's not the finished article. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to get incoming emails captured by PHP ?
Thanks, I changed the line to: ade: |/usr/bin/php /wwwroot/www.domain.com/ade/email.php And get this message back different but in essence the same I believe. I know the email.php doesn't do anything, I would love to get it there :) proving to be difficult :) - The following addresses had permanent fatal errors - |/usr/bin/php /wwwroot/www.domain.com/ade/email.php (reason: 255) (expanded from: [EMAIL PROTECTED]) - Transcript of session follows - Status: 404 Content-type: text/html X-Powered-By: PHP/4.3.11 No input file specified. 554 5.3.0 unknown mailer error 255 -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 10:51 AM To: Adrian Cc: php-general@lists.php.net Subject: Re: [PHP] How to get incoming emails captured by PHP ? Adrian wrote: I have my aliases file set up with the line: ade: |/usr/bin/php, |/wwwroot/www.domain.com/ade/email.php (The path to my PHP is correct) There should only be one | on that line. It should read... ade: /usr/bin/php /wwwroot/www.domain.com/ade/email.php And the script it calls (email.php) the code is: #!/usr/bin/php ?php $fd = fopen(php://stdin, r); $email = ; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); ? Hopefully you realise this script is just reading the email into $email and then not doing anything with it. Mail sent to this script will be lost, so here's hoping that's not the finished article. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get incoming emails captured by PHP ?
Adrian wrote: Thanks, I changed the line to: ade: |/usr/bin/php /wwwroot/www.domain.com/ade/email.php And get this message back different but in essence the same I believe. I know the email.php doesn't do anything, I would love to get it there :) proving to be difficult :) - The following addresses had permanent fatal errors - |/usr/bin/php /wwwroot/www.domain.com/ade/email.php (reason: 255) (expanded from: [EMAIL PROTECTED]) - Transcript of session follows - Status: 404 Content-type: text/html X-Powered-By: PHP/4.3.11 No input file specified. 554 5.3.0 unknown mailer error 255 Try.. ade: |/usr/bin/php /wwwroot/www.domain.com/ade/email.php Looks to me like PHP is not getting the argument. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to get incoming emails captured by PHP ?
THANK YOU! That did it, its now working, thank you for your help. -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 11:03 AM To: Adrian Cc: php-general@lists.php.net Subject: Re: [PHP] How to get incoming emails captured by PHP ? Adrian wrote: Thanks, I changed the line to: ade: |/usr/bin/php /wwwroot/www.domain.com/ade/email.php And get this message back different but in essence the same I believe. I know the email.php doesn't do anything, I would love to get it there :) proving to be difficult :) - The following addresses had permanent fatal errors - |/usr/bin/php /wwwroot/www.domain.com/ade/email.php (reason: 255) (expanded from: [EMAIL PROTECTED]) - Transcript of session follows - Status: 404 Content-type: text/html X-Powered-By: PHP/4.3.11 No input file specified. 554 5.3.0 unknown mailer error 255 Try.. ade: |/usr/bin/php /wwwroot/www.domain.com/ade/email.php Looks to me like PHP is not getting the argument. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php