virus filtering on courier-mta

A simple way to add virus filtering on a mail server running courier-mta.

  1. install clamav , a good free virus scanner.
    You may download it following this link: http://www.clamav.net/download/sources
    Follow instructions in the downloaded package for a correct install, usually  You need only to create clamav user, clamav group, then
    mkdir /var/lib/clamav (or whatever is set as clamav home dir in /etc/passwd)
    chown clamav:clamav /var/lib/clamav
    open clamav package, cd clamav package
    ./configure
    make
    make install
  2. install python-dev package (apt-get install python-dev)
  3. install pyClamd
    wget http://xael.org/norman/python/pyclamd/pyclamd.py
    cp pyclamd.py /usr/lib/python2.3/site-packages/
  4. install courier pythonfilter
    Standard installation steps are:
    python setup.py install
    mkdir /var/lib/pythonfilter
    chown daemon:daemon /var/lib/pythonfilter
    ln -s /usr/bin/pythonfilter /usr/lib/courier/filters
    filterctl start pythonfilter

Tags: ,

One Response to “virus filtering on courier-mta”

  1. saul says:

    Hi,
    retur this message error:
    Import individual modules rather than the “pythonfilter” container.
    Module “clamav” indicated in pythonfilter.conf does not exist.

Leave a Reply