debian上给postfix安装amavis+clamav

# apt-get update
# apt-get install clamav clamav-base clamav-daemon clamav-freshclam clamav-testfiles
# apt-get install amavisd-new

修改/etc/amavis/amavis.conf
$mydomain = 'example.com'
$forward_method = 'smtp:127.0.0.1:10025'; # descomente
$notify_method = $forward_method; # descomente

在/etc/postfix/master.cf中加入
smtp-amavis unix - - y - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - y - - smtp  ###(这里是没有d的)
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000

在/etc/postfix/main.cf中加入
content_filter=smtp-amavis:[127.0.0.1]:10024

修改某些文件的属性
chown -R amavis:amavis /var/run/clamav
chown -R amavis:amavis /var/lib/clamav
chown -R amavis:amavis /var/log/clamav

把clavav假如amavis组
gpasswd -a clamav amavis


修改/et/clamav/clamav.conf
We need to edit this file and change:
User clamav
to
User amavis