How To Setup MailScanner on Blue Quartz

Updated by Herb Rubin September 19, 2006:
Nuonce BQ Distribution 4.5
Spam Assassin is at version 3.1.7
MailScanner is at version 4.54.6-1
F-Protect is at version 4.6.6
or ClamAV is at version 0.88.6-1 (clamav, clamav-db and clamavd RPM files)

Install ncftp Package

This will help perl later install some packages into itself. Not required on Nuonce CentOS v4.2 / BlueQuartz ISO Image v3.5

rpm -Uvh ncftp*.rpm

Optional: Setup yum to point to Fedora Core 1 Legacy updates

Not required on Nuonce CentOS v4.2 / BlueQuartz ISO Image v3.5

This will help you be as up to date as you can with Fedora patches.

1) cp /etc/yum.conf /etc/yum_original.conf

2) add this to /etc/yum.conf:
name=Fedora Core $releasever updates

name=Fedora Legacy utilities for Fedora Core $releasever

3) type: yum check-update
and install any packages you think you might need for security reasons.
For example: yum update zlib zlib-devel

Make Sure You Have The GCC C Compiler

If you installed from the NUONCE distribution, you may not have the gcc compiler.
Check this condition by querying what rpm packages are installed.
type: rpm -qa | grep gcc


If you do not see most of the above, please use yum to download gcc
type: yum -y install gcc gcc-c++ gcc-objc libgcc patch rpm-rebuild

On Nuonce ISO 3.5: Use the BQ GUI to install the Nuonce package:
GCC Compile Tools v2.0. Just copy this link.

Install Required Perl Modules

Now, you are ready to enter the Perl shell and have it self install the required modules.

type: perl -MCPAN -e shell

then once in the shell, type these lines:
install Archive::Zip
install Archive::Tar
install Date::Manip
install HTTP::Cookies
install Parse::Syslog
install Statistics::Distributions
install Mail::SPF::Query
install Mail::SpamAssassin

install f-protect antivirus

rpm -Uvh fp-linux-ws.rpm
Get it from:

Install Mailscanner

Get it from
tar -zxvf MailScanner-4.54.6-1.rpm.tar.gz
cd MailScanner-4.54.6-1

Edit MailScanner.conf

vi /etc/MailScanner/MailScanner.conf

Please edit these lines:

%org-name% = yoursite
%org-long-name% = Your Organisation Name Here
%web-site% =
Quarantine Infections = yes --> Quarantine Infections = no
Minimum Stars If On Spam List = 0 --> Minimum Stars If On Spam List = 6
Notify Senders = yes --> Notify Senders = no
Send Notices = yes --> Send Notices = no
Spam Lists To Reach High Score = 3 --> Spam Lists To Reach High Score = 2
Rebuild Bayes Every = 0 --> Rebuild Bayes Every = 86400
High Scoring Spam Actions = deliver --> High Scoring Spam Actions = delete

Optional: DNS Blacklist

You can reject all relaying by spam IP addresses and help relieve some burden by MailScanner with this step. It is optional but useful.

cd /etc/mail
Place the following line right after: FEATURE(`blacklist_recipients')dnl
FEATURE(dnsbl, `', `Rejected - see')dnl
Then type: make

To activate MailScanner run the following commands:

service sendmail stop
cd /etc/rc.d/init.d
mv sendmail sendmailorig
cp MailScanner sendmail
service sendmail start

Make sure "service sendmail start" really started mailscanner by typing this:
ps -ef | grep Mail
and look for lines like: MailScanner: waiting for messages

Also, you can watch the mail logs live with:

tail -f /var/log/maillog

Press Control-C to break out of watching the maillog.

Fix bug with sending mail from web pages

There is a bug with sending mail from web pages such as with PHP's built in mail function. This will fix it.

cd /etc/mail
vi virtusertable

Add a line like this:   apache

and please don't put "" in there, please make sure it matches the hostname of the machine.

Then type: make

As an optional step you might want to fix the bugs in majordomo to get mailing lists working. Fix Majordomo