Jason Haar <Jason(_dot_)Haar(_at_)trimble(_dot_)co(_dot_)nz> writes:
I decided to use /etc/procmailrc to pre-filter the entire system's mail
accounts for spam (all I do is add a new header - noone actually looses
mail directly). It was all working grand until someone received a 90Mb mail
message - at that point the system basically ran out of memory and crashed
(well, I had to push the Big Button).
The /etc/procmailrc file doesn't do too much (a few header searches) - but
I wondered if the reason why it fell over was because /etc/procmailrc is
run as root instead of a normal user? As root it would have access to all
the memory on the system - as well as most of the spare disk :-) I assume
it would of been better to run this as the user it was meant for instead
of root.
It doesn't matter, as procmail is still running as root when it reads in
the message, which is when it slurps up the memory.
Could someone spell out to me how to get procmail to run with a limit on
how much memory it can use, and how to force it to run as the end-user?
That'd help things immensely :-)
You can't (simply) force it to run as the end-user. You can put limit
a limit on how big a message will be accepted by the system via the
MaxMessageSize option (i.e., "O MaxMessageSize=15728640") or you can
limit it on a per-mailer basis using the M= directive in the mailer
definition.
Philip Guenther