ClamAV - How To


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Email » Exim

ClamAV - How ToLast Modified: May 15, 2013, 1:23 am
*** Note *** Technical support for ClamAV is very limited. Use at your own risk.

To install ClamAV:

1) Install the binaries:

cd /usr/local/directadmin/custombuild
./build update
./build set clamav yes
./build clamav


2) Edit your /etc/exim.conf, and add the following before "primary_hostname  =":

av_scanner = clamd:127.0.0.1 3310

Skip this step (#2) if you are running CustomBuild 2.0, as it adds this for you with /etc/exim.clamav.load.conf.


3) While still editing your exim.conf, find "check_message:", and add this code below it:

deny message = This message contains malformed MIME ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
deny message = This message contains a virus or other harmful content ($malware_name)
demime = *
malware = */defer_ok
deny message = This message contains an attachment of a type which we  do not accept (.$found_extension)
demime = bat:com:pif:prf:scr:vbs
warn message = X-Antivirus-Scanner: Clean mail though you should still use an Antivirus


4) Restart exim:

/etc/init.d/exim restart            #Redhat/Debian
/usr/local/etc/rc.d/exim restart    #FreeBSD



Related optional script to ensure it's running




If you see this error:

Starting freshclam: ERROR: This tool requires libclamav with functionality level 63 or higher (current f-level: 62)

then see this guide on the forum.
 
Related Helpfiles
ClamAV - LibClamAV Error: cli_loaddb(): No supported database files found in /usr/share/clamav

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST