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

wget http://download.fedoralegacy.org/fedora/1/os/i386/ncftp-3.1.6-2.i386.rpm
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:
[updates]
name=Fedora Core $releasever updates
baseurl=http://download.fedoralegacy.org/fedora/1/updates/$basearch

[legacy-utils]
name=Fedora Legacy utilities for Fedora Core $releasever
baseurl=http://download.fedoralegacy.org/fedora/1/legacy-utils/$basearch

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

gcc-3.3.2-1
libgcc-3.3.2-1
gcc-c++-3.3.2-1
gcc-gnat-3.3.2-1
gcc-g77-3.3.2-1
gcc-java-3.3.2-1

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: http://www.f-prot.com/download/home_user/download_fplinux.html

Install Mailscanner

Get it from http://www.sng.ecs.soton.ac.uk/mailscanner/downloads.shtml
tar -zxvf MailScanner-4.54.6-1.rpm.tar.gz
cd MailScanner-4.54.6-1
./install.sh

Edit MailScanner.conf

vi /etc/MailScanner/MailScanner.conf

Please edit these lines:

%org-name% = yoursite
%org-long-name% = Your Organisation Name Here
%web-site% = www.your-organisation.com
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
vi sendmail.mc
Place the following line right after: FEATURE(`blacklist_recipients')dnl
FEATURE(dnsbl, `sbl-xbl.spamhaus.org', `Rejected - see http://sbl-xbl.spamhaus.org')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@www.yoursite.com   apache
Just after
MAILER-DAEMON@www.yoursite.com  MAILER-DAEMON

and please don't put "www.yoursite.com" 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

Home