1. Home
  2. User level DirectAdmin webhosting
  3. How to configure Spamassassin

How to configure Spamassassin

If you receive spam and you’ve enabled spamassassin it is possible to configure Spamassassin to reject e-mails that match with certain patterns. When a pattern is detected Spamassassin calculates points for it, and if the total points of all patterns together exceed the points that is configured in DirectAdmin (by default 5.0, you’ll find this in the e-mail headers too) Spamassassin can tag it with [SPAM], move it to your spam folder or delete the e-mail. You can also configure this in DirectAdmin.

For example spammers have a technique to send e-mails in the past, Spamassassin will detect this and adds a pattern like DATE_IN_PAST_24_48. You can find this in the e-mail headers probably in the properties in your e-mail client, this is different per e-mail client. Here is an example e-mail header:

 

Return-path:
Envelope-to: your@emaildomain.tld
Delivery-date: Tue, 21 Feb 2012 19:54:41 +0100
Received: from mail by any.hostname.tld with spam-scanned (Exim 4.76)
(envelope-from )
id 1AEurI-0001uE-Fc
for your@emaildomain.tld; Tue, 21 Feb 2012 19:54:41 +0100
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
any.hostname.tld
X-Spam-Level: ***
X-Spam-Status: No, score=3.6 required=5.0 tests=BAYES_60,DATE_IN_PAST_24_48,RDNS_NONE autolearn=no version=3.3.2
Received: from [123.123.123.123] (helo=mail.tld)
by any.hostname.tld with esmtp (Exim x.xx)
(envelope-from )
id 1AEurI-0001uE-Fc
for your@emaildomain.tld; Tue, 21 Feb 2012 19:54:40 +0100
Received: from apache by emaildomain.tld with local (Exim 4.67)
(envelope-from )
id 1AEurI-0001uE-Fc
for ; Tue, 20 Feb 2012 15:54:35 -0300
To: < your@maildomain.tld>
Subject: any subject
From:
X-Sender:
X-Mailer: PHP
X-Priority: 1
Content-Type: text/plain; charset=”windows-1250″
Message-Id:
Date: Tue, 20 Feb 2012 15:54:35 -0300
X-Antivirus-Scanner: Clean mail though you should still use an Antivirus

 

As you see Spamassassin has found 3 problems:

 

  • BAYES_60
  • DATE_IN_PAST_24_48
  • RDNS_NONE

 

In DirectAdmin you go to Spamassassin and click on “Manually edit the config file yourself”. If you want to change the score, you can add for every problem a new row with the amount of points after it, for example:

score BAYES_60 2.0
score DATE_IN_PAST_24_48 2.0
score RDNS_NONE 2.0

Because the total points of 5.0 is exceeded (total points are 6.0) the e-mail is detected as spam and will be threated as spam. You’ll find most problems listed here with some explanation but not all of them.

Updated on July 31, 2016

Was this article helpful?

Related Articles