[zeta] ezcMailParser: ezcMailVariableSet - Stream question

@]NBNYMAIL2.nbmedia.com" -->
From: Peter Brown <pbrown[@]nbmedia.com>
Date: Thu, 14 Nov 2013 18:53:33 +0000

Hello All,

I'm new to Zeta Components, and just discovered this list after
I downloaded the 2009 version of EZ Components.

By the way, I didn't see a web url for an archive of this list. Is it
on the web somewhere?

Things are working well, but I have a question.
I noted that incoming mail could be parsed using ezcMailVariableSet,
so I'm using the code below.

However, I'm wondering if there's a way to pipe the stream directly to the
$mail = $parser->parseMail( $set )
call, rather than assembling the stream into a variable first.

I ask this because I read that PHP could have an issue with memory consumption
if too many large emails are coming in at the same time (i.e. large attachments).

Is there a better way to do this? See my code below.

$parser = new ezcMailParser();

$stream = fopen("php://stdin", "r");

while (!feof($stream))
      {
      $incoming_email .= fread($stream, 1024);
      }

fclose($stream);

$set = new ezcMailVariableSet($incoming_email);

$mail = $parser->parseMail( $set );

Thanks!

Peter Brown
Received on Thu Nov 14 2013 - 19:03:18 GMT

This archive was generated by hypermail 2.2.0 : Sun Nov 12 2017 - 19:36:13 GMT