Sangat mudah, cuma 2 pakej diperlukan; spamassassin dam spamc
Sebagai root:
aptitude install spamassassin spamc
Pada pengguna/akaun e-mel yang ingin dilindungi, buat satu fail .procmailrc pada direktori utama pengguna tersebut dengan kandungan seperti berikut:
#########################################################################
# procmail.sample2
########################################################################## sample procmail file for spam filtering (enhanced version)
#
# Last modified: Thu 08 Jan 2004 01:42:11 PM CST
#
# CHANGES:
#
# 1/8/04: Added recipe to save “near misses” to a “probablespam”
# folder. Added lock file “spamassassin.lock” to recipe, as recommended
# in the spamassassin documentation.
#
# 1/7/04: Replaced the standalone version of spamassassin by the client
# version, spamc, to reduce the impact on system resources.
# Deleted the recipe for filtering the klez virus, as the virus seems
# to have runs its course and is no longer a problem.
#
#
# INSTRUCTIONS: Copy this file to .procmailrc in your home directory.
# See www.math.uiuc.edu/~hildebr/spamfiltering.html for more information.
#
# NOTE: This file is intended for users of the UIUC Mathematics
# Department’s Unix Network and has only been tested on that system.
# It will probably work with little or no modification on most standard
# Unix installations with SpamAssassin installed and running spamd,
# the daemonized version of spamassassin. Feel free to use or adapt
# it, but absolutely no warranties.
#
#
# ABOUT SPAMASSASSIN: Information about the SpamAssassin program
# that does the spam filtering can be found at www.spamassassin.org.#########################################################################
# set mail directory
#########################################################################MAILDIR = $HOME/mail
# This sets the directory in which the spam folder gets placed.
# The above setting is the one used by the pine mail reader for its
# folders. If you use pine, there is no need to change this setting.
#
# If you use a different mail reader (e.g., elm, mutt, netscape, dtmail,
# mail/mailx), you may want to replace this directory by the one where
# your mail reader normally puts its folders. (For example, netscape
# mail uses the directory “nsmail” (underneath $HOME), mutt uses
# “Mail”; for mail/mailx/dtmail check the “folder” setting in the
# .mailrc file.)
#
# [This is merely a matter of convenience to facilitate locating the
# spam folder. You can certainly leave the setting as above, or
# replace it by any directory of your choice. With most mail readers, you
# can access the spam folder directly using the “-f” option with
# the full path to the spam folder, e.g., “mail -f $HOME/mail/spam”
# or “pine -f $HOME/mail/spam”]
##########################################################################
# spam filter
##################################################################################################################################################
# First pipe email through spamc (the “client version” of spamassassin)
# for markup
########################################################################## The condition ” < 256000" limits spam filtering to messages that # are < 250k in size, as recommended in the spamassassin docs (for # performance reasons). Virtually all spam is well below that limit, # so having this condition there does not make a difference, as far # as spam filtering is concerned. :0fw: spamassassin.lock * < 256000 | /usr/bin/spamc ######################################################################### # Then route all email tagged as spam to a spam folder inside the # mail directory defined above ######################################################################### :0: * ^X-Spam-Status: Yes $MAILDIR/Spam ######################################################################### # Next, save "near misses" to a special folder "probablespam". ######################################################################### # Having a sufficiently large supply of such misses is useful for later # analysis and for training of SpamAssassin using the sa-learn program. # # The "c" flag in the first line of the recipe ensures that only copies # of the messages get rerouted in this way; the messages themselves # will pass through and show up in the message index of your mail # reader just like any other messages not flagged as spam. For that # reason there is no need to check the "probablespam" folder for false # positives. One can simply leave it alone and forget about it until # sufficiently many (say, a few hundred) messages have accumulated # there to be useful for the training of SpamAssassin with sa-learn. # # This recipe is optional. There is no harm in leaving it in and, as # mentioned, it may help improving the accuracy of SpamAssassin down # the road, but if you don't want it, simply delete it or comment it # out by putting a hash mark at the beginning of each line. :0c: * ^X-Spam-Level: \*\*\* $MAILDIR/probablespam ######################################################################### # Finally, remove header inserted by spamassassin ######################################################################### # This step is purely cosmetic. It removes the extra headers inserted # by spamassassin listing the "spam score" of the message and the # tests that the message passed or failed. Many legitimate messages # fail some of the tests that spamassassin performs, but the resulting # scores are usually well below the spam threshold, so the messages # will not be identified as spam. With most mail readers, those headers # won't be displayed anyway unless you specifically ask the mail # reader to display the full headers. However, if you save a message # and then print it out, the headers, including those inserted by spam # assassin, will get printed. # # :0fhw | formail -I "X-Spam-" # ######################################################################### # end of spam filter #########################################################################
Sekarang cuba hantar mel spam ke pengguna berkenaan. E-mel tersebut akan terus dimasukkan ke dalam folder ~/Spam
Sumber rujukan:
Installing spamassassin in webmin
http://spamassassin.apache.org/gtube/