Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [Original edit by JustinMason]

SpamAssassin/spamd seem to take a very long time to scan large emails, and

...

is 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:

No Format

  :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.

By default, procmail will spawn a new process for every email received; if your receive a lot of messages at a time (e.g., when you use fetchmail), procmail may create too many SpamAssassin processes. Just use a lock so procmail handles messages one at a time:

No Format

  :0fw: spamassassin.lock
  | spamassassin

(Page contents moved to OutOfMemoryProblems)See also OutOfMemoryProblems.