Quoting Clay Fandre (clay at fandre.com):
> I have a couple of really large mbox files loaded with spam that I'd
> like to filter. Anyone have a easy way of doing this? I tried sending
> it through spamassassin -P, but my system ran out of memory. Any way
> to parse 1 message at a time?

man formail

If I remember right:

cat spam | formail +1 -ds /usr/sbin/sendmail <sendmail commands>

Change -s param to what you want to do with each message.

-- 
Bob Tanner <tanner at real-time.com>         | Phone : (952)943-8700
http://www.mn-linux.org, Minnesota, Linux | Fax   : (952)943-8500
http://www.tcwug.org, Minnesota, Wireless | Coding isn't a crime. 
Fingerprint: 02E0 2734 A1A1 DBA1 0E15  623D 0036 7327 93D9 7DA3