This article is intended to aid people running a CPanel web server to install a mail virus scanner. This mail virus scanner will automatically scan all incomming mail, and remove all attachments that are found to contain a virus. It then inserts a text file into the email, notifying the recipient that a virus was found. Here is an example attachment from an email found to be containing a virus (slightly formated to fit):
These instruction will tell you how to install the MailScanner with the newest version of ClamAV:
| 1. |
Download the "Latest MailScanner installer" from the CPanel: Layer 1 Downloads link.
|
| 2. |
Extract the MailScanner on the server.
Ex: tar -xzvf mailscanner-autoinstall-1.5.tar.gz
|
| 3. |
Download the latest ClamAV (Virus Scanner) into the directory that was created during the extraction process.
Ie:
mailscanner-autoinstall-1.5/
|
| 4. |
Open the file 'claminstall' in your favorite editor, and find all lines with 'clamav-[old version]' in it. Change these lines to have the new version number you just downloaded from ClamAV.
Ex: (slightly modified to fit)
I downloaded clamav-0.70, so I would make the follow modifications:
Old file
#!/bin/sh
/scripts/adduser clamav /usr/local 0
chsh -s /bin/false clamav
if [ -e "/usr/sbin/pw" ]; then
/usr/sbin/pw lock clamav
else
passwd -l clamav
fi
tar xfzv clamav-0.60.tar.gz
(cd clamav-0.60;./configure --prefix=/usr \
--sysconfdir=/etc;make;make install)
echo "clamav.cpanel.net" > /usr/share/clamav/mirrors.pre
cat /usr/share/clamav/mirrors.txt >> /usr/share/clamav/mirrors.pre
mv -vf /usr/share/clamav/mirrors.pre /usr/share/clamav/mirrors.txt
touch /var/log/clam-update.log
chmod 600 /var/log/clam-update.log
chown clamav /var/log/clam-update.log
(cd /usr/local/bin;ln -s ../../bin/freshclam)
/usr/bin/freshclam
New (modified) file
#!/bin/sh
/scripts/adduser clamav /usr/local 0
chsh -s /bin/false clamav
if [ -e "/usr/sbin/pw" ]; then
/usr/sbin/pw lock clamav
else
passwd -l clamav
fi
tar xfzv clamav-0.70.tar.gz
(cd clamav-0.70;./configure --prefix=/usr \
--sysconfdir=/etc;make;make install)
echo "clamav.cpanel.net" > /usr/share/clamav/mirrors.pre
cat /usr/share/clamav/mirrors.txt >> /usr/share/clamav/mirrors.pre
mv -vf /usr/share/clamav/mirrors.pre /usr/share/clamav/mirrors.txt
touch /var/log/clam-update.log
chmod 600 /var/log/clam-update.log
chown clamav /var/log/clam-update.log
(cd /usr/local/bin;ln -s ../../bin/freshclam)
/usr/bin/freshclam
|
| 5. |
Now run './install', and after it is done installing, you are done. |