6. Mailscanner :: Sendmail :: 05 Install

Table of Contents

MailScanner:: Sendmail

Mailscanner Installation.

 

http://www.mailscanner.info/downloads.html

Copy just section at a time and paste them in to an ssh session on a server you want to upgrade, making sure you are doing so as root.

export ver=4.84.3-1

mkdir /zone
cd /zone
mkdir MailScanner
cd MailScanner
wget http://www.mailscanner.info/files/4/rpm/MailScanner-$ver.rpm.tar.gz
tar zxf MailScanner-$ver.rpm.tar.gz -C .
cd MailScanner-$ver
./install.sh

upgrade_MailScanner_conf MailScanner.conf MailScanner.conf.rpmnew >MailScanner.new
mv -f MailScanner.conf MailScanner.old
mv -f MailScanner.new MailScanner.conf

service sendmail stop
chkconfig sendmail off
chkconfig --level 2345 MailScanner on
service MailScanner start

 

If there are issues running this may help:

service MailScanner status
cannot open `/var/run/sendmail.in.pid' for reading


MailScanner --lint

Now we need to make changes to the configuration of MailScanner.

Find each of the configuration lines and make changes as appropriate.

emacs /etc/MailScanner/MailScanner.conf

%org-name% = HumanTypeNameWithNoSpaces
%org-long-name% = Human Type Name
%web-site% = www.fqdn.co.nz

Always Looked Up Last = &MailWatchLogging
Detailed Spam Report = yes
Quarantine Whole Message = yes
Quarantine Whole Message As Queue Files = no
Include Scores In SpamAssassin Report = yes
Quarantine User = root
Quarantine Group = apache (this should be the same group as your web server)
Quarantine Permissions = 0660

Spam Actions = deliver header "X-Spam-Status: Yes" store
High Scoring Spam Actions = deliver header "X-Spam-Status: Yes" store

Is Definitely Not Spam = &SQLWhitelist
Is Definitely Spam = &SQLBlacklist

Virus Scanners = clamav
Monitors for ClamAV Updates = /usr/local/share/clamav/*.cld /usr/local/share/clamav/*.cvd
# changed the above Oct 2009
Spam Subject Text = {Spam Minor _SCORE_}
High Scoring Spam Subject Text = {Spam BAD _SCORE_}
Quarantine Whole Messages As Queue Files = Yes????
Spam List = spamhaus-ZEN spamcop.net ORDB-RBL
#Spam Domain List = RFC-IGNORANT-DSN, dsn.rfc-ignorant.org.
#Spam Domain List = RFC-IGNORANT-POSTMASTER, postmaster.rfc-ignorant.org.
#Spam Domain List = RFC-IGNORANT-ABUSE, abuse.rfc-ignorant.org.
#Spam Domain List = RFC-IGNORANT-WHOIS, whois.rfc-ignorant.org.

I have been having issues with bouncing of emails back to people that do not exist. This is often know as back scatter. To over come this I have changed the following in MailScanner.conf.

# Notifications back to the senders of blocked messages

Notify Senders = no

 

# Notices to System Administrators
Send Notices = no

Or these commands will do the changes for you.

sed -ie 's/.*Notify Senders = yes.*$/Notify Senders = no/' /etc/MailScanner/MailScanner.conf \
&& grep "^Notify Senders =" /etc/MailScanner/MailScanner.conf


sed -ie 's/.*Send Notices = yes.*$/Send Notices = no/' /etc/MailScanner/MailScanner.conf \
&& grep "^Send Notices =" /etc/MailScanner/MailScanner.conf



/etc/init.d/MailScanner restart
grep "^Notify Senders =" /etc/MailScanner/MailScanner.conf
grep "^Send Notices =" /etc/MailScanner/MailScanner.conf
/etc/init.d/MailScanner status

Errors:

NOQUEUE: SYSERR(root): opendaemonsocket: daemon Daemon0: cannot bind: Address already in use

 

Setting up the eror messages

for i in `grep -r -e "For all your IT requirements visit" /etc/MailScanner/reports/*|cut -d":" -f1`
do
echo $i
sed -ie 's/.*www.transtec.co.uk.*$/For all your IT requirements visit: http:\/\/ai.net.nz/' $i
done

find /etc/MailScanner/reports -type f -name *.txte -exec rm {} \;

Run these commands to see if you have a clean installation. Looking for things that should be installed that are not. Not much more information I can give you here, this is just knowledge of MailScanner that will grow as you do it more.

clear
spamassassin -D --lint

If you get

config: no rules were found! Do you need to run 'sa-update'? Run sa-update

run

sa-update
MailScanner -v
MailScanner --lint

Also to set MailScanner to start on reboot, but sendmail not to:

service sendmail stop
chkconfig sendmail off
chkconfig --level 2345 MailScanner on
service MailScanner start

 

#Check Mailscanner

/etc/init.d/MailScanner status

Issues

 MailScanner will not start

NOQUEUE: SYSERR(root): opendaemonsocket: daemon Daemon0: cannot bind: Address already in use

Check

ps aux|grep sm
smmsp    20570  0.0  0.0      0     0 ?        Z    17:01   0:00 [sendmail] <defunct>
smmsp    21088  0.0  0.1   9788  1528 ?        Ss   17:03   0:00 sendmail: Queue runner@00:15:00 for /var/spool/clientmqueue

 

Kill the processes