Skip to content

Allow for larger attachments #433

@allestuetsmerweh

Description

@allestuetsmerweh

Is your feature request related to a problem? Please describe.
I have written an email forwarder, which reads the incoming messages from a catch-all mailbox using php-imap. I am generally very happy with it, but when people send email with large attachments, I see errors like these:
[...] Uncaught Exception Symfony\Component\ErrorHandler\Error\OutOfMemoryError: "Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 9282368 bytes)" at [...]/vendor/webklex/php-imap/src/Part.php line 196

Describe the solution you'd like
It would be nice, if php-imap would not load the whole Part content to memory, but instead, e.g. write the raw message to a temp file, and only reference parts by offset within that file (or similar)

Describe alternatives you've considered
None so far, but I am very open to other solutions, to the problem!

Additional context
I would like to contribute a PR, once we know how to solve the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions