[imp] attachement bigger than 12MB

Eric Rostetter eric.rostetter at physics.utexas.edu
Fri Jun 13 15:31:01 PDT 2003


Quoting Kim Hoffman <khoffman at uwo.ca>:

>  "There was an error sending your message: unable to send data"
> Found out that our sendmail/SMTP had a limit of 5000000 bytes. (I had the
> same
> problem with sending files bigger than 3.5M using our PINE client).

What is that set to now in sendmail?

> Also found out that the files grew in size when one sends it attached (~1.368
> X
> original size).  Listed at the end of the email are the 'experimental'
> results.

They can get as much as 2x bigger in general, though there is no real rule.
Always budget 2x if you want to be fairly safe.  More to be absolutely safe.
This is overhead from base64 encoding messages, adding MIME headers, etc.

> ian turley mentioned to check in php.ini file the three settings:
> ; Maximum amount of memory a script may consume (8MB)
> memory_limit = 8M
> ; Maximum size of POST data that PHP will accept.
> post_max_size = 8M
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 2M
>
> I increased the above in the same ratio 64M,64M,8M.  Not sure whether there

That would only allow uploads of 8M then if I read it right.  So raise that
last number to at least the size of attachement you want, possible 2 times
the largest attachment size you want to allow to account for overhead.

The post_size_max should be about the same as, perhaps one or two MB larger
than, the upload_max_filesize.

The memory_limit may have to be a lot bigger than the other two, since it
may be used to convert the file in memory.  So if it converts a 12 MB
attachment to a 24 MB attachement in memory, then you would have to set
memory limit to at least 12 + 24 = 36 MB, and then a bit more on top of
that for the actual code.  But this depends on your Horde, IMP, PEAR,
etc. versions.  So you have to experiment some.

For a 20 MB attachment, I'd use memory_limit = 80MB, post_size_max = 22MB,
upload_max_filesize = 22MB.

> a formula for increasing the size.  This might be an overkill.  Does someone
> has a formula for calculating this?

No, just experiement, and watch the log files.

If you are uploading these over a slow network link (56K modem) they may
take a long time to upload, and you may hit max_execution_time or what
have you.  So there are lots of things to watch for here.

Most people don't recommend sending large attachments via mail, in particular
web mail.  I limit mine to about 10MB which is think is very generous.  If
the file is larger than that there are usually better ways to transfer it
than email.

--
Eric Rostetter
The Department of Physics
The University of Texas at Austin

Why get even? Get odd!


More information about the imp mailing list