Spamassassin Howto


Von Roman (romanf auf trash.net)


Vorbereitungen

Bist du müde davon, das dir täglich mehrere Tonnen Mails mit prickelnden Subjects wie "get money fast" oder "enlarge your penis" ins Postfach purzeln? Dagegen lässt sich etwas machen. Spamassassin durchsucht sowohl die Header als auch den Text der Mail auf diverse Anhaltspunkte, die in Spams zu finden sind. Ein typischer Report sieht ungefähr so aus:

SPAM: -------------------- Start SpamAssassin results ----------------------
SPAM: This mail is probably spam.  The original message has been altered
SPAM: so you can recognise or block similar unwanted mail in future.
SPAM: See http://spamassassin.org/tag/ for more details.
SPAM: 
SPAM: Content analysis details:   (34.40 hits, 5 required)
SPAM: FROM_HAS_MIXED_NUMS (-0.9 points) From: contains numbers mixed in with letters
SPAM: SUBJ_ENDS_IN_SPACE (-0.4 points) Subject ends with lots of white space
SPAM: NO_REAL_NAME       (-0.3 points) From: does not include a real name
SPAM: USER_AGENT_OE      (-0.3 points) X-Mailer header indicates a non-spam MUA (Outlook Express)
SPAM: MIME_ODD_CASE      (3.5 points)  MiME-Version header (oddly capitalized)
SPAM: FROM_HAS_MIXED_NUMS2 (1.9 points)  From address matches known spammer format
SPAM: FROM_ENDS_IN_NUMS  (1.6 points)  From: ends in numbers
SPAM: INVALID_MSGID      (1.2 points)  Message-Id is not valid, according to RFC 2822
SPAM: TRACKER_ID         (3.2 points)  BODY: Incorporates a tracking ID number
SPAM: HOME_EMPLOYMENT    (2.9 points)  BODY: Information on how to work at home (2)
SPAM: FREE_MEMBERSHIP    (2.8 points)  BODY: Free Membership
SPAM: NO_COST            (2.7 points)  BODY: No such thing as a free lunch (3)
SPAM: REMOVE_IN_QUOTES   (2.1 points)  BODY: List removal information
SPAM: REMOVE_SUBJ        (1.7 points)  BODY: List removal information
SPAM: NO_OBLIGATION      (1.5 points)  BODY: There is no obligation.
SPAM: FOR_FREE           (1.4 points)  BODY: No such thing as a free lunch (1)
SPAM: MEMBER_2           (0.6 points)  BODY: Being a Member
SPAM: MEMBER             (0.6 points)  BODY: Member Stuff
SPAM: SPAM_PHRASE_08_13  (-0.1 points) BODY: Spam phrases score is 08 to 13 (medium)
SPAM:                    [score: 12]
SPAM: FORGED_AOL_RCVD    (3.9 points)  Received forged, contains fake AOL relays
SPAM: DATE_IN_FUTURE_12_24 (3.2 points)  Date: is 12 to 24 hours after Received: date
SPAM: MISSING_MIMEOLE    (1.6 points)  Message has X-MSMail-Priority, but no X-MimeOLE
SPAM: 
SPAM: -------------------- End of SpamAssassin results ---------------------

Typische Header einer nicht-spam Mail:

X-Spam-Status: No, hits=1.8 required=5.0
        tests=INVALID_MSGID,SPAM_PHRASE_00_01
        version=2.41
X-Spam-Level: *

Typische Header einer spam Mail:

X-Spam-Status: Yes, hits=34.4 required=5.0
        tests=DATE_IN_FUTURE_12_24,FORGED_AOL_RCVD,FOR_FREE,
              FREE_MEMBERSHIP,FROM_ENDS_IN_NUMS,FROM_HAS_MIXED_NUMS,
              FROM_HAS_MIXED_NUMS2,HOME_EMPLOYMENT,INVALID_MSGID,MEMBER,
              MEMBER_2,MIME_ODD_CASE,MISSING_MIMEOLE,NO_COST,
              NO_OBLIGATION,NO_REAL_NAME,REMOVE_IN_QUOTES,REMOVE_SUBJ,
              SPAM_PHRASE_08_13,SUBJ_ENDS_IN_SPACE,TRACKER_ID,
              USER_AGENT_OE
        version=2.41
X-Spam-Flag: YES
X-Spam-Level: **********************************
X-Spam-Checker-Version: SpamAssassin 2.41 (1.115.2.8-2002-09-05-exp)
X-Spam-Prev-Content-Transfer-Encoding: 8bit

Aufgrund verschiedener Kriterien vergibt Spamassassin Punkte, ist die Maximalpunktzahl erreicht (hier 5) so gilt die Mails als Spam, und wird von Spamassassin getaggt. Diese Tags können von procmail ausgewertet werden.

Aktivieren von Spamassassin auf trash.net

Eine einfache Anleitung um Spamassassin auf trash.net zu aktivieren findest du hier.