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.
###########################################################################

# How many points before a mail is considered spam.
# required_score                5

# Whitelist and blacklist addresses are now file-glob-style patterns, so
# "friend@somewhere.com", "*@isp.com", or "*.domain.net" will all work.
# whitelist_from        someone@somewhere.com

# Add your own customised scores for some tests below. The default scores are
# 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

# Speakers of Asian languages, like Chinese, Japanese and Korean, will almost
# 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

# Set the score required before a mail is considered spam.
##required_score 5.00

# uncomment, if you do not want spamassassin to create a new message
# in case of detecting spam
# report_safe 0


# SpamAssassin config file for version 3.x
# 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)

# How many hits before a message is considered spam.
required_score           5.0

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe             1

# Enable the Bayes system
use_bayes               1

# Enable Bayes auto-learning
bayes_auto_learn        1

# Enable or disable network checks
skip_rbl_checks         0
use_razor2              0
use_dcc                 0
use_pyzor               0

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages            all

# Mail using locales used in these country codes will not be marked
# 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

Digg it! Artikel ausdrucken Artikel weiterempfehlen Als PDF-Datei anzeigen
Übersetzungsvorschlag für Übersetzungsvorschlag für
Bewertung der Nützlichkeit dieses Artikels:

Durchschnittliche Bewertung: 0 von 5 (0 Bewertungen)

vollkommen überflüssig 1 2 3 4 5 sehr wertvoll

Kommentieren nicht möglich