Configuring SpamAssassin and spamd

Julian Field mailscanner at
Sat Feb 28 16:39:00 GMT 2004

Quoting Kai Schaetzl <maillists at CONACTIVE.COM>:
> Don Newcomer wrote on         Fri, 27 Feb 2004 16:59:42 -0500:
> > I see my other option being to call spamd from procmail.  Would using MS
> > still be faster?
> >
> you either use MS + SA (which calls the SA lib, not the script) or a
> milter + spamd, not both. And you sure not use procmail for this on
> non-home machines.

I don't know how many times I have explained this now.... :-)

Fundamentally, SpamAssassin is a big library of Perl functions, that
implement a system for working out a score for each message based upon its

Spamd is a daemon which takes requests from the spamc client program and
calls the function library to process them, then gets the results back and
returns some output through the spamc client program. The library has to be
setup once when the spamd program starts, so is quite fast. However, it has
overheads involved in starting up the spamc client program for each message
and all the I/O involved in passing the message through spamc and onto spamd.

Another way of talking to the library is using the "spamassassin" script,
which is a very slow way of talking to the library. The entire library has
to be setup every time you call the "spamassassin" script. However, it is
useful for doing stuff like checking all your configration files are correct
and things like that.

The third way of using the library is the way MailScanner does it. It calls
the function library directly from Perl, with no overheads involved in
starting any other programs at all (not even the overhead of running the
spamc program). It gives the message directly to the function library, and
gets the results straight back from it, with absolutely as little I/O as is
possible. This is definitely the fastest way of using SpamAssassin, and also
doesn't rely on anything else not crashing (spamc relies on spamd always
being there, and fails totally if it's not running properly).

So don't think that calling procmail (in order to call spamc in order for it
to talk to spamd in order for it to pass the message the function library
and return all the results all the way back to sendmail) is going to be any
faster, because it will not and cannot be faster. In comparison, MailScanner
bypasses procmail, spamc and spamd in the processing of a message by

Please can someone post this in the FAQ so I don't have to explain it all
again? Thanks folks!

mailscanner at

More information about the MailScanner mailing list