This is a discussion on php://stdin limits? within the PHP Language forums, part of the PHP Programming Forums category; Hello, I've made a script that parses emails with attachments. I tested the code using input from a file ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I've made a script that parses emails with attachments. I tested the code using input from a file and everything was parsed correctly. However when I used "php://stdin" and piped emails to the script, it seems to just quit half way thru. There are no errors....but also no output. Is there a size limit for emails being piped to a script? Even with an attachment of 3k, it doesn't work. Can it not handle multi part MIME emails? thanks, David |
|
|||
|
David,
I have been working with these alot lately. I kept finding that I forgot to chmod the script I was sending it to correctly. Check your chmod. Near as I can tell there isn't a limit, I am sending about 500,000 characters and stripping sections out, and posting to a database, and creating a new page........and sending a few dozen of these e-mails back to back with no problems. If you display your code I will try and come take a peek. Ed http://www.stmadeveloper.com "David Bruno" <webmaster@lowestdomains.info> wrote in message news:crs2pb$e2v$1@daisy.noc.ucla.edu... > Hello, > I've made a script that parses emails with attachments. > I tested the code using input from a file and everything was parsed > correctly. > However when I used "php://stdin" and piped emails to the script, > it seems to just quit half way thru. There are no errors....but also no > output. > Is there a size limit for emails being piped to a script? Even with an > attachment > of 3k, it doesn't work. Can it not handle multi part MIME emails? > > thanks, > David > > |
|
|||
|
"David Bruno" <webmaster@lowestdomains.info> wrote in message
news:crs2pb$e2v$1@daisy.noc.ucla.edu... > Hello, > I've made a script that parses emails with attachments. > I tested the code using input from a file and everything was parsed > correctly. > However when I used "php://stdin" and piped emails to the script, > it seems to just quit half way thru. There are no errors....but also no > output. > Is there a size limit for emails being piped to a script? Even with an > attachment > of 3k, it doesn't work. Can it not handle multi part MIME emails? > > thanks, > David > Sounds like a pipe deadlock to me. That happens when a child process has filled up the output buffer and starts to wait for the parent process to move some data off the buffer. But the parent process is waiting for the child process to clear up some space in the input buffer so it can push in more data. So the whole thing stalls. Two way pipes are tricky to implement. I don't think PHP gives you the necessary means to do it. |