From Wiki
Jump to: navigation, search

What Is MailScanner?

MailScanner is an e-mail security and anti-spam package for mail servers.

Installation and Upgrade Instructions

If the cPanel Clamavconnector is installed (WHM > cPanel > Manage Plugins) remove it - this plugin is *not* compatible with MailScanner. To do this from the command line:

/usr/local/cpanel/scripts/check_cpanel_rpms --fix --targets=clamav

Next download and install MailScanner.

cd /usr/local/src
tar -xzf msinstall.tar.gz
cd msinstall/

If you are performing a new installation, select option 1. If you are performing an upgrade, select option 1. If you are performing a upgrade and want to skip the full perl module installation, take option 2.

Next you will need to disable the following options in WHM:

WHM > Tweak Settings > Set "Enable Apache SpamAssassin™ spam filter" and "Enable BoxTrapper spam trap" to Off.

WHM > Service Manager > Uncheck both boxes for "Apache SpamAssassin™" and click "Save"

Packages > Feature Manager > Edit the feature list "disabled" and uncheck "Apache SpamAssassin™" and "Apache SpamAssassin™ Spam Box"

Create /scripts/postupcp (or add the perl line if this file already exists) with the following contents:

perl /usr/mscpanel/

Set the correct permissions on /scripts/postupcp

chmod 700 /scripts/postupcp

Configure MailScanner to scan local domains. There is a script to synchronize the MailScanner installation with the /etc/localdomains file.

/usr/bin/perl /usr/mscpanel/ -i

You can then check the files in /usr/mailscanner/etc/rules/*.rules and modify them if desired. There are instructions and examples in the README and EXAMPLES files in that directory.

Create a cron job to run this automatically.

echo "0 0 * * * perl /usr/mscpanel/ > /dev/null 2>&1" >> /var/spool/cron/root

MailScanner can be configured by editing the file /usr/mailscanner/etc/MailScanner.conf. There are detailed explanations and instructions in that file. Restart MailScanner after making modifications to this file.

service MailScanner restart

Once installed you will also need to register the the MailScanner addon with AppConfig

vim /var/cpanel/apps/mailscanner.conf

Insert the following content into the mailscanner.conf file created above.

<source lang='text'>

# name


  1. Service that will serve this app


  1. Physical path: /usr/local/cpanel/3rdparty/Foo.php
  2. Literal URL path: $server:$port/$cpsession/3rdparty/Foo.php


  1. System user to run process as


  1. Required acls


  1. Display name as show in the service ui

displayname=addon_mailscanner </source>

Register the app:

/usr/local/cpanel/bin/register_appconfig /var/cpanel/apps/mailscanner.conf