SpamAssassin/spamd seem to take a very long time to scan large emails, and are bogging down my server. What can I do?
Spamassassin will attempt to scan anything you throw at it. However, the time taken to scan messages rises exponentially with the message size. The best way to deal with this problem is to limit the size of messages that get scanned by SpamAssassin.
For procmail, the following recipe works:
:0fw
- < 200000 | spamassassin
(The "* < 200000" line prevents messages over 200,000 bytes from being passed to SpamAssassin.)
If you're using spamd, you should be aware that spamc will only pass messages under 250k in size to spamd. This is a built-in limit that you can override using the "-s" option on the command-line. Refer to the spamc man page for more details.
See also OutOfMemoryProblems.