Drew
Installing SpamAssassin is very straight forward. It does however have dependancies. Just like with amavisd-new, we can take care of these with the perl CPAN interface. First of all, lets start up the CPAN shell and get all the prerequisites installed.
enter the CPAN shell with :
Then we install the following packages. Remember to let it install and sub-dependancies by hitting enter when asked.
install HTTP::Date
install LWP
install Net::DNS
install NetAddr::IP
install Digest::SHA1
install HTML::Parser
install IO::Zlib
install Archive::Tar
install HTML::Parser
install DB_File
install IO::Socket::SSL
install Mail::SPF
install IP::Country
install Net::Ident
install Mail::DKIM
install Encode::Detect
Now that the ground work is done, we need to get the latest source from http://spamassassin.apache.org/. When we build SpamAssassin it will ask for an email address to be used in suspected-spam reports. You may enter any email you like, though I would suggest you use your postmaster account.
Expand the archive and build SpamAssassin using the following commands :
cd Mail-SpamAssassin-3.3.1
perl Makefile.PL
make
make test
sudo make install
Now that it is installed, we need to configure it. SpamAssassin has placed all its configuration files in /etc/mail/spamassassin/. By default there are 6 files in there, and each one is read in turn. Because we have not installed the Razor2 program the help SpamAssassin we have to disable the code that calls it.
Open the file /etc/mail/spamassassin/v310.pre and comment out line 32.
from :
to:
Now that that is done, the last thing to do is to get the spam rules for SpamAssassin to use. That is a single command :
This will fetch and install a bunch of spam rules for SpamAssassin to work with. You can add your own rules, and you can train SpamAssassin for ham and spam as well. Please see the SpamAssassin documentation for more details.



Comments
10:54 pm
Note: in my case, at least, the configuration files were placed in:
/etc/opt/mail/spamassassin/ rather than /etc/mail/spamassassin/
1:30 pm
I was unable to reproduce that without specifying /etc/opt in the config line.
9:07 pm
I have installed Amvisd, ClamAV, and SpamAssassin onto my Snow Leopard. I see processes for clamd and freshclam, but I see nothing for spamd. Also, there is no log entry for sa. You had a great deal info on launchd plist to get everything running except SpamAssassin. What do we do once it is installed to get it running – to have it inspect incoming mail and flag it as spam or ham?
Thank you.
10:44 am
Hi Lewis,
It should be running as is. It runs under amavisd. You will find log entries in the amavisd.log for spamassassin.
Training your install is easy enough, once you have a collection of spam and ham mails. You can get the official instructions from here http://wiki.apache.org/spamassassin/BayesInSpamAssassin