Dreamhost webmail2 now includes SpamAssassin. Compiling your own local copy of the filter is unnecessary.
First off, this article applies only to Dreamhost users who have a shell account. You need a shell account because there is some required UNIX scripting involved. The whole process takes about 5 minutes to get up and running.
Installing SpamAssassin
Download the latest stable release of SpamAssassin, preferably in tar.gz format, from spamassassin.org. Open up your FTP program. If you don’t have an FTP client, download SmartFTP (Windows users) or Fetch (Mac users).
Log on to your web site via FTP and upload the SpamAssassin TAR file in BINARY format to the root directory. The root directory will list your web site, e.g. steinbaugh.com and it should contain a folder called Maildir.
Next, you need to log on to the server and run some commands. If you don’t have an SSH client, I recommend PuTTY (Windows users) or MacSSH (Mac users). Opt to log on to the server — use your domain name, e.g. steinbaugh.com — via SSH and be sure to use Port 22 (default SSH port). You will be greeted with a username/password prompt. If you can’t remember your login, reset it in the Dreamhost control panel.
Once you log in successfully, run the following commands:
tar xvfz Mail-SpamAssassin-2.61.tar.gz
cd ~/Mail-SpamAssassin-2.61
perl Makefile.PL PREFIX=~/sausr SYSCONFDIR=~/saetc
make
make install
SpamAssassin is now installed on the server. The next step is to set it up.
Configuring SpamAssassin
I’ve already created the four files you need to get SpamAssassin up and running. They are:
- .forward.postfix
- .procmailrc
- spam.rc
- user_prefs
These files are available for download: spamassassin-2.61.tar.gz.
Again, upload the TAR file to your root directory and untar it using the SSH client. All you need to type to untar the file is:
tar xvfz spamassassin-2.61.tar.gz
Go back into your FTP client and locate the four extracted files (should be in a folder titled spamassassin-2.61). Move .forward.postfix and .procmailrc to the root directory. If these files already exist, back them up first and replace them.
Next, create a folder titled .spamassassin on the web root and move the user_prefs file into it.
Finally, move the spam.rc file to your procmail directory. If the procmail folder doesn’t exist, create it.
For testing purposes, I recommend modifying the .procmailrc file by turning verbose mode on and logging to all. This way you can check and make sure that SpamAssassin is working properly.
Now, send yourself an e-mail. View the full message header of the e-mail. You should see SpamAssassin outputting a header that says version 2.61. If it says version 2.20, the install failed. Dreamhost has an old version of SpamAssassin on the server which is currently 2.20. If you install is corrupted, version 2.20 will be called up instead.
I currently have Razor reporting turned off. Some Dreamhost customers have reported to me that Razor doesn’t work well with the SpamAssassin install. If you get Razor working with SA 2.61, please report what you did here. I heard that using -h with spamassassin in the spam.rc file might resolve the issue.
Once you’re done configuring and have verified that SpamAssassin is working, feel free to delete the Mail-SpamAssassin-2.61 directory from the server. All of the important SpamAssassin files are in saetc and sausr.
Upgrading
For a successful upgrade, delete the saetc and sausr folders. Then follow the guide above using the new version. The upgrade should work!