Temp files leftover in /tmp sucking up all space

I have my max attachment size set to 3Mb. Occasionally, I get a
"brilliant" customer who decides to email a 5 or 7 Mb attachment to
our RT (running 3.2.3). What happens is that some temp file is
created in /tmp of a huge size, and then rt-mailgate dies. The mail
logs show something like this:

Oct 3 03:02:54 w01 postfix/local[28234]: 9F290362CA: to=,
relay=local, delay=257901, status=deferred (temporary failure.
Command output: An Error Occurred ================= 500 Server
closed connection without sending any data back )

and the temp file is left sitting there sucking up valuable space.
Eventually, after the mail server retries that message a handful of
times, /tmp fills up and all heck breaks loose.

What can I do to protect myself from this? Can mailgate do the usual
open/delete/use tempfile trick that make unix special? Or do I need
to bump up the maxmem setting for mail processes or something?

I have my max attachment size set to 3Mb. Occasionally, I get a
“brilliant” customer who decides to email a 5 or 7 Mb attachment to
our RT (running 3.2.3). What happens is that some temp file is
created in /tmp of a huge size, and then rt-mailgate dies. The mail
logs show something like this:

Oct 3 03:02:54 w01 postfix/local[28234]: 9F290362CA: to=,
relay=local, delay=257901, status=deferred (temporary failure.
Command output: An Error Occurred ================= 500 Server
closed connection without sending any data back )

and the temp file is left sitting there sucking up valuable space.
Eventually, after the mail server retries that message a handful of
times, /tmp fills up and all heck breaks loose.

What can I do to protect myself from this? Can mailgate do the usual
open/delete/use tempfile trick that make unix special? Or do I need
to bump up the maxmem setting for mail processes or something?

Is it the mailgate or the server-side? (I’d been under the impression
that we’d clobbered this bug on the server side as of 3.4.0 or so.)

Are you using modperl or fcgi? If mod_perl, does it help to tune your
threads to answer fewer requests? (Some of the tempfiles may be cleaned
at “program” exit)

Oct 3 03:02:54 w01 postfix/local[28234]: 9F290362CA: to=,
relay=local, delay=257901, status=deferred (temporary failure.
Command output: An Error Occurred ================= 500 Server
closed connection without sending any data back )

Is it the mailgate or the server-side? (I’d been under the impression
that we’d clobbered this bug on the server side as of 3.4.0 or so.)

Must be server since the error says “500 server closed connection”,
and rt-mailgate successfully returns EX_TEMPFAIL to postfix. I’ll
upgrade to 3.4.x in a day or so during my planned upgrade of apache
to apache2 and perl + friends on the server in question. If it
persists I’ll report back.

Are you using modperl or fcgi? If mod_perl, does it help to tune your
threads to answer fewer requests? (Some of the tempfiles may be
cleaned
at “program” exit)

mod_perl. apache children handle 50 requests and then die, or if
they’ve gotten too big they die. i’m planning to move to fcgi to cut
down my process load (right now I have a separate mod_perl instance
just for RT).