Type the following into your shell on Matrix:
These instructions create your Spamassassin configuration folder and its contents and allow spamd to read and write them. You will want to alter user_prefs using your favourite text editor(e.g. vim). Mine is linked at the bottom of this page.
Note for Non-Matrix users:
The above lines should only be used if your system uses spamd and the filesystem on your home directory supports ACLs.
Replace 'spamd' above with the user that spamd runs as.
If this isn't the case use spamassassin rather than spamc in the .procmailrc below.
The next step is to set up Procmail so that all you mail will be passed to SpamAssassin.
The following is at the start of my ~/.procmailrc:
DEFAULT=/home/bbrazil/mail/default/ #alter as appropriate PMDIR=/home/bbrazil/.procmail YEARMONTH=`date '+%Y-%B'` LOGFILE=$PMDIR/procmail-log-$YEARMONTH SHELL=/bin/sh MAILDIR=/home/bbrazil/mail/ #### Spamassassin :0fw: spamassassin.lock |/usr/local/bin/spamc :0c: spamassassin.lock #Force all spam learnt * ^X-Spam-Status: Yes |/opt/csw/bin/sa-learn --spam :0: * ^X-Spam-Status: Yes caught-spam/ :0 c: #Save all non-spam in one place archives/$YEARMONTH
Remember that your .procmailrc MUST NOT be world or group writable. To ensure this run:
chmod og-w ~/.procmailrc
I use Mutt for email as its the best client I've come across.
Here are some useful lines for your muttrc for use with SpamAssassain.
set folder=/home/bbrazil/mail #alter as appropriate. Needed for the '+' set wait_ke y=no #Should be a better way of doing this macro pager "S" "<pipe-message>sa-learn --spam >/dev/null &<enter><save-message>=spam<enter>" macro index "S" "<pipe-message>sa-learn --spam >/dev/null &<enter><save-message>=spam<enter>" macro pager "H" "<copy-message>=ham<enter><pipe-message>sa-learn --ham >/dev/null </dev/null &<enter><enter>" macro index "H" "<copy-message>=ham<enter><pipe-message>sa-learn --ham >/dev/null </dev/null &<enter><enter>" unignore X-Spam-Status unignore X-Spam-Report mailboxes +ham +spam +caught-spam +default
These lines will allow your to use 'S' and 'H' to mark ham and spam, and transfer them to the appropriate folders. They also will show relevant Spam headers. You'll probably want to start Mutt with the -y option to view all the folders.