Skip to main content

How to install unrar with Clamav for MailScanner?

The unrar command is used to extract, list or test archive files only .ClamAV will need unrar, it can be installed from rpmforge repository, so:
# cd /usr/local/src/
# wget http://62.171.191.140/mw/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# rpm -ivh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm 
# yum update -y
# yum install unrar
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
Note: RPMForge is now RepoForge & might be outdated. There is no updates since very long time.
After installing unrar, Disabled rpmforge repo: 
# sed -i 's/enabled = 1/enabled = 0/g' /etc/yum.repos.d/rpmforge.repo
# yum update -y 
Viruses are commonly spread as attachments to email messages. Install the following packages for Amavis to extract and scan archive files in email messages such as .7z, .cab, .doc, .exe, .iso, .jar, and .rar files.
# yum install arj bzip2 cpio file gzip nomarch spax unrar p7zip unzip zip lrzsz lzip lz4 lzop 
FreshClam Setup: freshclam will update the virus signature database. To enable it and update
# sed -i -e 's/^Example/#Example/' /etc/freshclam.conf
# freshclam -v 
Also Edit as : ( Add the following line at bottom of line )
# vi /etc/sysconfig/freshclam
#FRESHCLAM_DELAY=disabled-warn  # REMOVE ME 
The MailScanner will call /usr/local/bin/freshclam to update the database, so make the proper link:
# ln -s /usr/bin/freshclam /usr/local/bin/freshclam 
# cp -a /usr/bin/clamdscan /usr/bin/clamdscan-cmd
No Need to change any settings for Clamav because we already install SpamAssassin, Clamav & Amavisd with CWP7.Pro.

Test clamd service:

# wget http://www.eicar.org/download/eicar.com 
# clamscan --infected --remove eicar.com
/tmp/eicar.com: {HEX}EICAR.TEST.3.UNOFFICIAL FOUND
/tmp/eicar.com: Removed.

----------- SCAN SUMMARY -----------
Known viruses: 8574631
Engine version: 0.103.3
Scanned directories: 0
Scanned files: 1
Infected files: 1
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 22.513 sec (0 m 22 s)
Start Date: 2021:08:09 00:22:37
End Date:   2021:08:09 00:23:00
Install Clamav if you don't install any control panel
# yum info clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd
# yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd 
Follow the following link to install unrar : Link 1 & Link 2 

Comments