User Tools

Site Tools


Setup clamav with Postfix on Debian Lenny in a chroot

Quick and dirty instructions on setting up Postfix to scan messages using clamav on Debian Lenny.

Install clamav and clamav-milter:

apt-get install clamav
apt-get install clamav-daemon
apt-get install clamav-milter

Edit /etc/default/clamav-milter and uncomment the following lines


If you don't want the postmaster and sender to be emailed each time a virus is detected then add the letter q to the OPTIONS line at the beginning of the file as such:

OPTIONS="--max-children=2 -olq"

Create somewhere within the Postfix chroot for the clamav-milter socket to sit. The default location cannot be seen by Postfix when it is in a chroot jail.

mkdir -p /var/spool/postfix/clamav/
chown clamav:postfix /var/spool/postfix/clamav/
chmod g+s /var/spool/postfix/clamav/

Restart the milter:

/etc/init.d/clamav-milter restart

Add the following lines to /etc/postfix/ to enable the milter (assumes you want to accept emails on milter failure):

milter_connect_macros = i b j _ {daemon_name} {if_name} {if_addr}
smtpd_milters = unix:/clamav/clamav-milter.ctl
milter_default_action = accept

Restart Postfix:

/etc/init.d/postfix restart
setup_clamav_with_postfix_on_debian_lenny_in_a_chroot.txt · Last modified: 2018/12/06 21:47 by abeverley