Using Spam Filtering

Built into our mail system is the latest production release of SpamAssassin, to our knowledge, the most advanced and reliable spam filter available. This guide describes how users can enable spam filtering and configure our e-mail system to process messages in a specific way, based on the results of SpamAssassin's tests.

Basic spam filtering (web interface)

Most people will want spam delivered to a "Spam" folder of a mailbox. To configure this, go to the Mail Service / Mail Addresses section of the web interface, enter your new address in Configure a new address and select Mailbox (with spam folder) as the destination. This will arrange for mail determined to be spam to be delivered to the "Spam" folder of your mailbox.

We strongly recommend that you configure your mail client software to regularly purge old messages from "Spam", since keeping mailbox folders with too many messages (i.e., over 10,000) will cause the IMAP server (and consequently your mail client) to eventually become less responsive.

You can click on existing e-mail addresses to edit them. E-mail addresses (or wildcards) can be associated with a set of rules containing some condition and an instruction determining which action the mail server should take. A condition of spam>=5.0 evaluates to true when the SpamAssassin test returns a value greater than or equal to 5.0. A condition of spam<=5.0 evaluates to true when the check returns a value less than or equal to 5.0. If the condition is set to just "spam", mail is only tagged prior to delivery to the destination (i.e., a mail header is inserted to indicate the results of the spam test, and possibly harmful content is moved to an attachment).

Alternate method: Configure from the command-line
If you prefer to configure your e-mail addresses from the command-line, use the mail rule commands of csoftadm. It is often convenient to use a macro, when multiple addresses share the same delivery instructions:
  csoftadm> mail rule add &mymacro spam>=6.0 /dev/null
  csoftadm> mail rule add &mymacro spam<=6.0 mymailbox
  csoftadm> mail alias add me@domain.ext &mymacro
  csoftadm> mail alias add myself@domain.ext &mymacro
Alternate method: Classification with external program

Experimented users may want to perform more complex filtering and classification tasks. The standard programs procmail and maildrop are available for this purpose. To use those, configure e-mail addresses with a destination of |procmail or |maildrop. Setting the conditional field to just "spam" when configuring an address can be useful where you want mail to be checked and tagged prior to delivery to procmail or maildrop:

  csoftadm> mail rule add me@domain.ext spam |procmail
Configuring SpamAssassin
SpamAssassin provides numerous configuration parameters. These parameters are documented in detail under Mail::SpamAssassin::Conf, and are controlled from the ~/.spamassassin/user_prefs file (you can create ~/.spamassassin/ if it doesn't exists). We strongly recommend configuring at least ok_locales. A typical user_prefs file might look like:
  # Customize Subject tag
  rewrite_header Subject ******SPAM*******
  
  # Expect messages in French, English
  ok_locales en fr
  
  # Whitelist various From addresses
  whitelist_from addr@lists.sourceforge.net
  
  # Supplement whitelist_from with a check against Received: headers.
  # The second parameter should match the reverse DNS.
  whitelist_from_rcvd addr@lists.sourceforge.net sourceforge.net

Note that the required_score setting in user_prefs will not be honored on our servers, since the score threshold is already configured along with e-mail addresses in the control panel or csoftadm (see below).

Depending on your server, the mail system may or may not be running on the same machine which you normally log into, but /mailXX (e.g., /mail123/ if your mail server is called mail123.csoft.net) will always provide a NFS (network filesystem) mount to the mirror copy of your home directory on whichever server is currently processing e-mail. Whenever you are done editing user_prefs, copy it to the /mail*/yourname/.spamassassin/ directory. This will make the changes effective without having to wait for the mirror to update.

  $ mkdir /mailXX/myname/.spamassassin
  $ cp -f ~/.spamassassin/user_prefs /mailXX/myname/.spamassassin
Tweaking test scores

Each SpamAssassin test is assigned a number referred to as the score. If the sum of the scores of each test performed on a message meets the spam threshold, the message is classified as spam. The spam threshold is configurable from the control panel or csoftadm on a per-address basis.

The full list of SpamAssassin tests is available here. If you wish to change the score of a test, add the following to your user_prefs:

  score NAME_OF_TEST 3.0

To disable a test entirely, you can do:

  score NAME_OF_TEST 0
Links

This web site - © 2012 Csoft.net Hosting, Inc.
(Contact Us) (Privacy Policy)
  LPF Valid HTML 4.01 Transitional