[#6676] Large attachments
Summary Large attachments
Queue IMP
Queue Version HEAD
Type Enhancement
State Duplicate
Priority 1. Low
Requester david.newcomb (at) bigsoft (dot) co (dot) uk
Created 2008-05-02 (4753 days ago)
Updated 2008-05-02 (4753 days ago)
Resolved 2008-05-02 (4753 days ago)
Patch No

2008-05-02 17:07:20 Michael Slusarz Comment #5
State ⇒ Duplicate
Reply to this comment
Duplicate of Ticket 4753.
2008-05-02 17:01:55 Chuck Hagenbuch Comment #4 Reply to this comment
K, well, that won't be helped by saving the data to a file.

Michael S., wasn't this improved recently?
2008-05-02 16:48:26 david (dot) newcomb (at) bigsoft (dot) co (dot) uk Comment #3 Reply to this comment
It is exploding at:

$Horde: imp/lib/MIME/Contents.php,v 2007/08/07 19:53:40 
slusarz Exp $

/usr/share/psa-horde/imp/lib/MIME/Contents.php 173

The error is:

[client xxx.xxx.xxx.xxx] PHP Fatal error:  Allowed memory size of 
33554432 bytes exhausted (tried to allocate 9962983 bytes) in 
/usr/share/psa-horde/imp/lib/MIME/Contents.php on line 173

Allowed memory size of 33554432 bytes exhausted (tried to allocate 0 bytes)

I think you (the royal you) are reading all the mime attachments into memory.

The attachment was 9MB so given:

             $this->_bodypart[$id] = str_replace("\r\n", "\n", 

You need 18MB of storage not including any other copies which may be 
in scope, or other attachments.

2008-05-02 15:27:57 Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Can you be more specific about where memory is exhausted? We could 
save the data to a file, but without stream support in the imap 
module, we're just as likely to run out of memory fetching the data to 
put in that file as we are serving it back to the user.
2008-05-02 11:11:32 david (dot) newcomb (at) bigsoft (dot) co (dot) uk Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Large attachments
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
Reply to this comment
Occasionally my users get send large attachments which don't download 
because the php process exceeds the php max memory.

Is there a chance that the file could be saved locally so the user can 
download the file via normal http i.e. not via a php program.

I could increase the php max memory, but that option is there for my 
"general" protection and shouldn't really be used for these types of 

Saved Queries