Introduction: How to Use Full Featured SpamAssassin on Hosted Accounts

Picture of How to Use Full Featured SpamAssassin on Hosted Accounts

I host a domain or two on They have great hosting features such as an SSH shell, mysql, php support and more.

They don't however have a full fledged SpamAssassin install. They have a weird stripped down version that only lets you add blacklists and whitelists. You have no way to create custom filters.

This will show you how to install your own local copy of SpamAssassin, use procmail to process the messages, and filter your email through your local SpamAssassin install.

Step 1: Install Spamassassin

To install spamassassin you can do this:
tar -zxvf Mail-SpamAssassin-3.2.5.tar.gz
cd Mail-SpamAssassin-3.2.5
perl Makefile.PL PREFIX=$HOME
make && make install

Step 2: Procmail Setup

Set up procmail:
vi ~/.procmailrc
:0fw: spamassassin.lock
| /usr/home/YOUR_USER_NAME/bin/spamassassin

*X-Spam-Flag: Yes

# enable logging

Step 3: Set Up Spamassassin Rules

Picture of Set Up Spamassassin Rules

Set up a few simple spamassassin rules in .spamassassin/user_prefs

#We would blacklist domains like
blacklist_from *
#that would block all emails from macys

Step 4: Log in to

Picture of Log in to

Log in to
Go to email management

Step 5: Default

Picture of Default

Make sure your default account is set to discard all email. I was getting 400+ spams a day to that account when I was not throwing it out.

Step 6: Create a Recipe

Picture of Create a Recipe

Create a recipe for your domain.
Click on create new recipe.

Step 7: Recipe

Picture of Recipe

type the name of the account, then choose filter.

Step 8: Recipe

Picture of Recipe

Enter /usr/local/bin/procmail as the E-mail Filter.
Select Create Filter

Step 9: Done

You are done, you can try sending some test mail and tailing the log file. But you should be good now.



About This Instructable




Bio: I like to tinker with just about anything, sometimes it works out in the end. Have fun looking at the projects, try tearing something open ... More »
More by joe:Intel Edison Garage Monitor and Alert SystemIntel Edison Fat Bike Tire AnalyzerIntel Galileo Garage Monitor
Add instructable to: