The revised guide for versions 2.61 and above has been posted.
First off, this article applies only to Dreamhost users that have a shell account. You need a shell account because there is some required UNIX scripting. The whole process took me about an hour last night but since I already took the plunge, it should only take five minutes or so for you to set SpamAssassin after having read my guide.
Richard Donkin originally posted a SpamAssassin for Dreamhost guide but it’s a little outdated. It sure helped me with the installation though. I figured I’d update the guide a little bit since at the time of this post, the current version of SpamAssassin is 2.55 — Richard’s guide covers version 2.20.
First, head over to the SpamAssassin download page. Download the latest stable release in tar.gz format. Log on to your web server and upload this folder to the root directory in BINARY format. The root directory should have some folders like Maildir, logs, etc. If you don’t have a Maildir folder, Dreamhost has a kbase post for you!
Next, download Richard’s SpamAssassin setup tar and upload it to the root folder in BINARY.
Now you’re ready to do a little bit of UNIX scripting. Make sure you have a decent telnet/SSH client — I use PuTTY. Connect to your web site via SSH (you can also use Telnet). Type the following command (make sure the file name is correct):
tar xvfz Mail-SpamAssassin-2.55.tar.gz
tar xvfz spamassassin-setup.tar.gz
Check to make sure that the folders Mail-SpamAssassin-2.55 and spamassassin-setup are present in your root directory. If not, you didn’t untar the files correctly. If you can’t figure it out, I suggest praying to Google or e-mailing me.
Next, you have to install SpamAssassin in your account. Type the following, one line at a time:
cd ~/Mail-SpamAssassin-2.55
perl Makefile.PL PREFIX=~/sausr SYSCONFDIR=~/saetc
make
make install
You should notice the server processing a lot of files after make and make install. Don’t worry, you didn’t break anything. Actually, Dreamhost encourages you to install your own version of SpamAssassin. Check and make sure the directories saetc and sausr are present in the root directory.
Now you can move the Mail-SpamAssassin-2.55 folder. Create a folder in the root called lib. Move Mail-SpamAssassin-2.55 into the lib folder.
Next, you have to create a symbolic link to the SpamAssassin directory. In your SSH client, type:
ln -s ~/lib/Mail-SpamAssassin-2.55 ~/lib/SpamAssassin
Finally, you have to transfer Richard’s spamassassin setup files. Make two more folders in your root directory: .spamassassin and procmail. Move the .rc files into the procmail folder and the user_prefs file into the .spamassassin folder. Move the .forward.postfix and .procmailrc files to the root. If there is an existing .procmailrc file, back it up and replace it with the new one.
Send yourself a test mail and a test spam. Check the procmail log, located in ~/procmail/log. You should get output here. Also, check and make sure the SpamAssassin headers appear in your e-mail — just use SquirrelMail and check the message header.
At the time of this post, Richard’s spam.rc needed modifying. Edit the file and get rid of the -P flag. Dreamhost doesn’t allow that any more.
SpamAssassin should be all set up and ready to go. Enjoy! It works a lot better than Razor. I’ve used SpamAssassin for my UCLA e-mail for two years and it catches about 99 percent of spam, without trashing valid e-mails.