This requires a working knowledge of the unix shell, and a Dreamhost.com email account that has ssh privileges
Why should I use these instructions?
This setup installs almost everything under a folder called .spamassassin and other .\w* files -- which means that all of these files will not appear during ftp listings or normal directory listings.
It also centralizes what you need to update on future releases or delete if you so desire.
What does this do with tagged mail? And what is bayes?
This setup delivers mail scoring 10points or higher into a spam-probable directory. You should go through that directory often and make sure you're not losing mail to the filters. You can tweak the spam threshold in the user_prefs file. Bayes is basically an adaptive filter to differentiate spam from non-spam. This setup enables the bayes filter, but it will not work until you have trained it. To train it, look into the spamassassin documentation itself. Essentially, you will need to start the bayes system off with a sample of definate spam, and a sample of definite non-spam -- or 'ham'. After running spamassassin for a week or two, you can use your inbox as a source of non-spam, and your spam-probable folder as a source of spam -- make sure to week through those two folders first though. You can play around with the procmail settings and do differnt things with your tagged spam as well. Try sending spam <10 to Inbox, 10 < 30 to spam-probablye, 30+ to spam-definate.
LOGIN & MAKE NECESSARY DIRECTORIES
$ ssh ##YOUR_SERVER## $ mkdir SA_INSTALL $ mkdir ~/.spamassassin $ mkdir ~/.procmail $ cd SA_INSTALL
DOWNLOAD SPAMASSASSIN
visit http://spamassassin.org/downloads.html , copy-link-location for the latest downloadable version in tar.bz2 format)
##LATEST_RELEASE## is, for example Mail-SpamAssassin-2.63 )
$ wget http://spamassassin.org/released/##LATEST_RELEASE##.tar.bz2 $ bzip2 -d ##LATEST_RELEASE##.tar.bz2 $ tar -xf ##LATEST_RELEASE##.tar $ cd ##LATEST_RELEASE##
CONFIGURE AND INSTALL SPAMASSASSIN
$ perl Makefile.PL PREFIX=~/.spamassassin/sausr SYSCONFDIR=~/.spamassassin/saetc $ make $ make install
CONFIGURE MAIL DELIVERY AND SCANNING
See below for contents of files
$ cd ~ $ mv .forward.postfix .forward.postfix.dreamhost $ mv .procmailrc .procmailrc.dreamhost $ vi .forward.postfix $ vi .procmailrc $ vi .spamassassin/spam.rc $ vi .spamassassin/user_prefs
Check your installation
Good idea
Remove installation directory
Wait until things are working before you do this
$ cd ~ $ rm -r SA_INSTALL
$ vi .forward.postfix
USE ANY EDITOR, JUST MAKE THE FILE CONTAIN WHAT IS BELOW
"|/usr/bin/procmail -t"
$ vi .procmailrc
USE ANY EDITOR, JUST MAKE THE FILE CONTAIN WHAT IS BELOW
# ~/.procmailrc for SA_DREAMHOST # Directory for storing procmail-related files PMDIR=$HOME/.procmail SADIR=$HOME/.spamassassin # Set to yes when debugging # VERBOSE=yes # Logging # LOGFILE=$PMDIR/log # Remove # when debugging; set to no if you want minimal logging # LOGABSTRACT=all # Message directory (Courier IMAP and mutt) MAILDIR=$HOME/Maildir # Include the spamassassin configuration INCLUDERC=$SADIR/spam.rc # filter 2 - first check message with razor-check; next rule is chained with 'a' flag :0 Wc | razor-check # filter 2 :0 Wa .dh-spam/ # Anything that hasn't been filtered yet is delivered to your inbox by this # recipe. The '/' at end of pathname indicates a Maildir format mailbox $HOME/Maildir/
$ vi .spamassassin/spam.rc
USE ANY EDITOR, JUST MAKE THE FILE CONTAIN WHAT IS BELOW
# spam.rc: procmail recipes to process email through SpamAssassin :0fw: spamassassin.lock | $HOME/.spamassassin/sausr/local/bin/spamassassin # Dump all tagged spam into separate folder :0: * ^X-Spam-Status: Yes .spam-probable/
$ vi .spamassassin/user_prefs
USE ANY EDITOR, JUST MAKE THE FILE CONTAIN WHAT IS BELOW
NOTE the ##USERNAME## on line 22 -- you MUST change that to your dh username, and give the correct path for bayes
These are sample configurations. You can read the SpamAssassin instructions for more info.
# How many hits before a message is considered spam. required_hits 10.0 # Whether to change the subject of suspected spam # Do not rewrite the subject line with "****SPAM****" by default rewrite_subject 0 #subject_tag *** SPAM: _HITS_: # Put report in the headers report_header 1 use_terse_report 1 # This is optional # disable web bugs and other potentially dangerous attachements report_safe 0 # Enable the Bayes system use_bayes 1 # Enable Bayes auto-learning auto_learn 1 # Set Bayes DB Path bayes_path /home/##USERNAME##/.spamassassin/bayes # bayes_file_mode (default: 0700) # bayes_use_hapaxes (default: 1) # bayes_use_chi2_combining (default: 0) # bayes_expiry_min_db_size (default: 100000) # bayes_expiry_scan_count (default: 5000) # Enable or disable network checks skip_rbl_checks 0 use_razor2 0 use_dcc 0 use_pyzor 0 # Define the filename used to store Razor's configuration settings. Currently this is left to Razor to decide. #razor_config /etc/razor/site.conf ok_languages en ok_locales en