Linux
ID #1012
Spamassassin auf Suse 9.3 installieren
Was ist wichtig um Spamassassin auf einem Suse9.3-System mit Courier-IMAP und Procmail zu installieren?
Installation
$ yast -i spamassassin perl-spamassassin
Konfiguration
~/.spamassassin/user_prefs:
# SpamAssassin user preferences file. See 'perldoc Mail::SpamAssassin::Conf' # for details of what can be tweaked. ###########################################################################
# required_score 5
# "friend@somewhere.com", "*@isp.com", or "*.domain.net" will all work. # whitelist_from someone@somewhere.com
# read from the installed spamassassin rules files, but you can override them # here. To see the list of tests and their default scores, go to # http://spamassassin.apache.org/tests.html . # # score SYMBOLIC_TEST_NAME n.nn
# definitely want to uncomment the following lines. They will switch off some # rules that detect 8-bit characters, which commonly trigger on mails using CJK # character sets, or that assume a western-style charset is in use. # # score HTML_COMMENT_8BITS 0 # score UPPERCASE_25_50 0 # score UPPERCASE_50_75 0 # score UPPERCASE_75_100 0 |
/etc/mail/spamassassin/local.cf:
# Add your own customisations to this file. See 'man Mail::SpamAssassin::Conf' # for details of what can be tweaked. # # do not change the subject # to change the subject, e.g. use # rewrite_header Subject ****SPAM(_SCORE_)**** ##rewrite_header Subject
##required_score 5.00
# in case of detecting spam # report_safe 0
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6 # See http://www.yrex.com/spam/spamconfig25.php for earlier versions # Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)
required_score 5.0
report_safe 1
use_bayes 1
bayes_auto_learn 1
skip_rbl_checks 0 use_razor2 0 use_dcc 0 use_pyzor 0
# as being possibly spam in a foreign language. ok_languages all
# as being possibly spam in a foreign language. ok_locales all |
Einbindung in Procmail
| ## Variablen-Definition ############################################################# SENDER=$1 RECIPIENT=$2 FETCHMAILRECIPIENT=$3 MAILBASE=/pfad/zum/mailverzeichniss/des/users BOX=$MAILBASE/$RECIPIENT ## Spamassassin -> SA-Learn (Spam or Ham) ############################################################# :0 * ^.*To: *spam@.* { * < 256000 :0c: spamassassin.spamlock | sa-learn --spam :0: spamassassin.filelock $BOX/.SPAM/ } :0 * ^.*To: *nospam@.* { * < 256000 :0c: spamassassin.spamlock | sa-learn --ham :0: spamassassin.filelock $BOX/.NOSPAM/ } ## Spamassassin -> in SPAM-Ordner einsortieren ############################################################# # Pipe the mail through spamassassin (replace 'spamassassin' with # 'spamc' if you use the spamc/spamd combination) # # The condition line ensures that only messages smaller than 250 kB # (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam # isn't bigger than a few k and working with big messages can bring # SpamAssassin to its knees. # # The lock file ensures that only 1 spamassassin invocation happens # at 1 time, to keep the load down. # :0fw: /pfad/zu/maillogs/spamassassin/spamassassin.lock * < 256000 | /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: \*\*\*\*\* $BOX/.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 $BOX/.SPAM/ |
Junk-Ordner manuell als Spam einlesen lassen
$ su <mail_user>
$ sa-learn --showdots --spam /pfad/zum/mailverzeichniss/des/users/.Junk/cur/
non-Junk-Ordner manuell als Ham (=Nicht-Spam) einlesen lassen
$ su <mail_user>
$ sa-learn --showdots --ham /pfad/zum/mailverzeichniss/des/users/.nonJunk/cur/
Quellen:
http://wiki.kde.org/tiki-index.php?page=Spamassassin%2C+Sylpheed%2C+Korn%2C+and+Fetchmail
http://www.yrex.com/spam/spamconfig.php
http://wiki.apache.org/spamassassin/BayesInSpamAssassin
Tags: -
Verwandte Artikel:
Letzte Änderung des Artikels: 2007-02-08 20:05
Verfasser des Artikels: Florian Schrön
Revision: 1.0
Kommentieren nicht möglich