Opened 14 years ago

Last modified 9 years ago

#131 new defect

larger quaratined email causes error in viewmail.php

Reported by: karl@… Owned by: rjl
Priority: normal Milestone: post-1.0.3 triage
Component: PHP scripts Version: 1.0.0 RC5
Severity: normal Keywords:


When attempting to view a larger quarantined email I get the following error:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2965693 bytes) in /var/www/html/mailguard/application/secure_site/viewmail.php on line 369

My php.ini has the default 8MB memory limit.

Change History (6)

comment:1 Changed 13 years ago by rjl

  • Milestone set to 1.0.2
  • patch set to 0

It may make more sense to simply limit how much of a large message we display in the Mail Viewer. Clearly we don't want to load a multi-megabyte attachment-laden e-mail when we're really only interested in viewing the text/plain and text/html portions. Since we can't display attachments of other types anyway, why bother loading them into the MIME structure at all? We just need to note the content type of the attachment in that case, so that we can acknowledge it in the Mail Viewer.

comment:2 Changed 13 years ago by stephen@…

This problem is also realised when releasing those same e-mails, so possibly restricting the view isn't enough?

comment:3 Changed 13 years ago by dmorton

  • Milestone changed from 1.0.2 to 1.0.3

comment:4 Changed 10 years ago by mortonda@…

I wonder if we can use a combination of memory_get_usage and ini_get to determine if we have enough memory allocated... but to be precise we need some sort of metric of how much memory is used by the MIME parsing routines.

comment:5 Changed 10 years ago by mortonda@…

The Mail_MIME libs, and the PEAR DB ones for that matter, do not appear to support stream processing - thus we have to load the whole contents into memory to process.

The closest process I have found to date that might help is but we are a long way from making that a requirement.

Ultimately, the issue here is that php.ini should specify a large enough value to handle the maximum message size plus overhead.

comment:6 Changed 9 years ago by mortonda@…

  • Milestone changed from 1.0.3 to post-1.0.3 triage

This isn't going to be fixed easily, bumping out of 1.0.3

Note: See TracTickets for help on using tickets.