Courier ClamAV (Antivirus) Filter

Last updated March 2005

This document outlines two methods for setting up ClamAV as a filter for the Courier Mail Server. Both methods allow you to block mail at the SMTP level, which means errors can be reported to senders without the risk of spamming a forged From address.

Method 1: Using Courier's built-in perlfitler

If you have never used filters before, and/or you just want to get things running as quickly as possible, use this method:

  1. Make sure the 'clamd' daemon is running.
  2. Download the clamav-perlfilter file and save it to your <courier-configdir>/filters/ directory.
  3. Place a single line, the path to the clamav-perlfilter you just downloaded, in the file <courier-configdir>/filters/perlfilter.
  4. If you want to enable this filter by default for all mail accounts, place the word "all" in <courier-configdir>/filters/perlfilter-mode.
  5. Load Courier's perlfilter with "filterctl start perlfilter".
  6. Start courierfilter (or stop and then start if already running).

Method 2: Using Courier::Filter

Note: This method is somewhat obsoleted because Courier::Filter now ships with a ClamAVd module that served the same purpose.

This method requires you to already be running Courier::Filter. You should be comfortable using Courier::Filter and ensure that you have it working properly before continuing.

You also need to install Mail::ClamAV.

Once you have Courier::Filter running and you have installed Mail::ClamAV, download ClamAV.pm and put it in the Courier/Filter/Module/ directory. Then add the appropriate configuration lines to pureperlfilter.conf and restart courierfilter.

Note that this method does not require you to run the clamd daemon.