Re: Mailparse bug
| From: | Wez Furlong | Date: | Mon, 19 Jan 2004 10:59:52 +0000 |
| Subject: | Re: Mailparse bug | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-355@lists.php.net to get a copy of this message | ||
Using the procedural interface will also be less expensive.
The OO stuff is not yet as stable as the not-so-easy-to-use procedural
API (which is that way for backwards compatibility with some ooold
code that I can't change).
--Wez.
<bmansion@mamasam.com> wrote :
> Hi picklers,
>
> Here is the warning I get after parsing about 1000 mails with mailparse
> extension in a loop:
>
> PHP Warning: mimemessage(/web/archive/2001/tcpdumpwigginout.txt): failed
to
> open stream: Too many open files in /web/parsebig_mailparse.php on line 75
>
>
> I got about 12000 messages to parse.
>
> Code :
>
> foreach ($files as $i => $file) {
>
> $msg =& new MimeMessage('file', $file);
> $header = $msg->data['headers'];
> // Do some cleanup of the headers
>
> unset($header);
> unset($msg);
> }
>
>
> Is this a mailparse bug ?
> If yes, do you know a workaround (apart from "reduce the number of mails
you
> parse with mailparse ;)
Overlooked the obvious, I now use:
$mail = file_get_contents($file);
$msg =& new MimeMessage('var', $mail);
And it's much better.
Bertrand Mansion
Mamasam
--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php