This explains how to use Spamassassin to remove a lot of the spam that is sent as emails.

**** Page under construction ****

Prerequisites

Ensure sendmail is working for send and receiving mail externally

Spamassassin RPM needs to be installed
Procmail RPM needs to be installed

Configuration

vi /etc/mail/spamassassin/local.cf
required_score 6
report_safe 1
rewrite_header Subject *****SPAM*****

loadplugin Mail::SpamAssassin::Plugin::WhiteListSubject

header SUBJECT_IN_WHITELIST eval:check_subject_in_whitelist()
describe SUBJECT_IN_WHITELIST Subject header is in user's white-list

header SUBJECT_IN_BLACKLIST eval:check_subject_in_blacklist()
describe SUBJECT_IN_BLACKLIST Subject header is in user's black-list

score SUBJECT_IN_WHITELIST -100
score SUBJECT_IN_BLACKLIST 100

# blacklists
#
blacklist_from *from*
blacklist_subject *subject*

# whitelists
#
whitelist_from *from*
whitelist_subject *subject*

vi /etc/procmailrc
[root@mail etc]# more procmailrc
#DROPPRIVS=yes
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin
SHELL=/bin/sh

# Directory for storing procmail configuration and log files
# You can name this variable anything you like, for example
# PROCMAILDIR, or don't set it (but then don't refer to it!)
PMDIR=$HOME/Procmail

# LOGFILE should be specified ASAP so everything below it is logged
# Put ## before LOGFILE if you want no logging (not recommended)
LOGFILE=$PMDIR/pmlog

# Spamassassin
#:0fw
:0fw: /var/tmp/spamassassin.lock
* < 100000
| /usr/bin/spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
/var/mail/almost-certainly-spam
#
# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
/var/mail/probably-spam
#
## Work around procmail bug: any output on stderr will cause the "F" in "From"
## to be dropped.  This will re-add it.
#:0
#* ^^rom[ ]
#{
#  LOG="*** Dropped F off From_ header! Fixing up. "
#  
#  :0 fhw
#  | sed -e '1s/^/F/'
#}
#

For each user create procmail log file
# touch $HOME/Procmail/pmlog

Testing

# tail -f $HOME/Procmail/pmlog