User Tools

Site Tools


This is an old revision of the document!

SpamAssassin Plugin Documentation

Plugin allows to use SpamAssassin with i-MSCP.


  • i-MSCP versions >= 1.1.0
  • Spamassassin 3.3.x
  • Roundcube 0.9.x
  • See installation section for required software packages.

Existing milter configurations

This plugin will not check for an existing milter configuration in the Postfix file. If you need to add an extra milter, please ask in our forum!


1. Install the needed Debian / Ubuntu packages

Installation of spamassasin packages:

# aptitude update
# aptitude install spamassassin spamass-milter libmail-dkim-perl libnet-ident-perl libencode-detect-perl

Debian Squeeze - from backports

Add the backports of Debian Squezze to your /etc/apt/sources.list:

deb squeeze-backports main contrib non-free

Installation of spamassasin packages:

# aptitude update
# aptitude -t squeeze-backports install spamassassin
# aptitude install spamass-milter libmail-dkim-perl libnet-ident-perl libencode-detect-perl

Optional install pyzor and razor

# aptitude install pyzor razor

2. Get the plugin from Plugin Store

3. Plugin upload and installation

  • Login into the panel as admin and go to the plugin management interface
  • Upload the SpamAssassin plugin archive
  • Install the plugin


1. Get the plugin from Plugin Store

2. Backup your current plugin config

# plugins/SpamAssassin/config.php

3. Plugin upload and update

  • Login into the panel as admin and go to the plugin management interface
  • Upload the SpamAssassin plugin archive
  • Update the plugin list


For the different configuration options please check the plugin config file.

# plugins/SpamAssassin/config.php

After you made your config changes, don't forget to update the plugin list.

  • Login into the panel as admin and go to the plugin management interface
  • Update the plugin list

3rd party SpamAssasin Plugins


The DecodeShortURLs plugin looks for URLs shortened by a list of URL shortening services and upon finding a matching URL will connect using to the shortening service and do an HTTP HEAD lookup and retrieve the location header which points to the actual shortened URL, it then adds this URL to the list of URIs extracted by SpamAssassin which can then be accessed by other plugins, such as URIDNSBL.


iXhash2 is an unofficial improved version of iXhash plugin for SpamAssassin, adding async DNS lookups for performance and removing unneeded features. It's fully compatible with the iXhash 1.5.5 implementation.

Included Roundcube Plugins


If enabled in the config.php file, the Roundcube plugin markasjunk2 adds a new button to the mailbox toolbar to mark the selected messages as 'Junk'/'Not Junk' and will also learn the bayesian database. It will also detach original messages from spam reports if the message is not junk.


If enabled in the config.php file, the Roundcube plugin sauserprefs adds a 'Spam' tab to the 'Settings' to allow the users to change their SpamAssassin preferences which are stored in the imscp_spamassassin database. The SpamAssassin preferences shown in Roundcube will vary depending the changes you make in the config.php file.

Roundcube user config: Settings → Spam

Move Spam into Junk folder

If you want to move Spam massages into the users Junk folder, you will need the Roundcube Plugin managesieve, which is included in the I-MSCP Plugin RoundcubePlugins.

SpamAssassin user preferences

The default SpamAssassin user preferences are stored in the table userpref of the imscp_spamassassin database.

Global SpamAssassin preferences

These are the $GLOBAL default values which will be imported during plugin installation.

username preference value
$GLOBAL required_score 5
$GLOBAL rewrite_header Subject *****SPAM*****
$GLOBAL report_safe 1
$GLOBAL use_bayes 1
$GLOBAL use_bayes_rules 1
$GLOBAL bayes_auto_learn 1
$GLOBAL bayes_auto_learn_threshold_nonspam 0.1
$GLOBAL bayes_auto_learn_threshold_spam 12.0
$GLOBAL use_auto_whitelist 0
$GLOBAL skip_rbl_checks 1
$GLOBAL use_razor2 0
$GLOBAL use_pyzor 0
$GLOBAL use_dcc 0

The $GLOBAL values will be used as long as the user has no specific entries in the table. If you want to change some $GLOBAL options, please do that directly in the database.

Per-Domain SpamAssassin preferences

You could also specify domain specific entries, which will be used as default only for that domain, until the user has no individual entry in the userpref table. Here are some examples for the domain

username preference value required_score 8 rewrite_header Subject [ SPAM ] report_safe 0

Per-User SpamAssassin preferences

If you enabled the Roundcube Plugin sauserprefs in the config.php file, then the user can change his SpamAssassin preferences under Roundcube → Settings → Spam.

The user preferences will also be stored in the userpref table with the mail address as username.

username preference value required_score 6 rewrite_header Subject [SPAM-_HITS_]


GTUBE (Generic Test for Unsolicited Bulk Email)

Send yourself a mail from another account (e.g. gmail or any other freemailer) with the following content in the message:


Note that this should be reproduced in one line, without whitespace or line breaks.


/var/www/virtual/ · Last modified: 2014/02/18 21:18 by mrpink