Out of memory on large attachments

I’ve got a problem with large attachments. I have the
$MaxAttachmentSize set to 1 MB since I don’t really want large
attachments in my RT…

However, I have the situation that when someone emails a ticket to me
with a large attachment, of say, 5Mb encoded, RT issues a temporary
error and the mail server retries that message over and over again,
resulting in mayhem. For example, I have one ticket that had like 80
copies of the text part of the email, but no copies of the attached
file (until I killed the message from the mail queue).

The RT error log shows something like this:

[Tue Aug 24 03:17:28 2004] [crit]: Out of memory during “large” request
for 8392704 bytes, total sbrk() is 44761088 bytes at
/usr/local/lib/perl5/5.8.4/CGI.pm line 679.

There’s nothing of use from the maillog:

status=deferred (temporary failure. Command output: RT server error.
The RT server which handled your email did not behave as expected. It
said: )

So whatever error RT wanted to send back, it was too long for postfix
to log…

RT 3.2.1
mod_perl 1.29
Postgres 7.4.3
FreeBSD 4.10-RELEASE
apache 1.3.31
perl 5.8.4
cpan says I have the latest versions of all installed modules (except
DBD::Pg which has a major bug in the latest version)

The data limit is set to 64Mb per process, which appears to be what
we’re hitting… how big do I need to make the memory limit to handle a
5Mb attachment (so it can be refused due to the size limit)?

smime.p7s (2.42 KB)

Try to switch GET/POST method to libapr instead of CGI.
In lib/RT/Interface/Web.pm delete string
args_method => “CGI”,
I think it can decrease memory usage.

If it wouldn’t help ofcouse you can increase limit, but in any case this
should be considered as RT bug cause sending of mails with large
attachments could be used as variant of DOS attacks.

Vivek Khera wrote: