Posts Tagged ‘courier-mta’

virus filtering on courier-mta

Monday, March 23rd, 2009

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