Clamav是一个比较好的杀毒程序,他被amavisd调用,可以查杀所有常见的病毒,在邮件系统中我们用它来对邮件进行查毒,

1、安装Clamav

安装时选择

ARC
ARJ
LHA
UNZOO
UNRAR

shell

# cd /usr/ports/security/clamav && make install clean

2、修改配置文件

shell

# vi /usr/local/etc/clamd.conf

修改以下内容:

User vscan

shell

# vi /usr/local/etc/freshclam.conf

修改以下内容:

DatabaseOwner vscan

设置开机自启

shell

# vi /etc/rc.conf

增加两行

clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"

3、使Amavis-new对Clamav的支持

修改amavisd.conf文件:

shell

# vi /usr/local/etc/amavisd.conf

增加如下内容:

@av_scanners = (
['ClamAV-clamd',
   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
   qr/\bOK$/, qr/\bFOUND$/,
   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

4、修改权限设置

shell

# chown –R vscan:vscan /var/run/clamav/
# chown –R vscan:vscan /var/log/clamav/
# chown –R vscan:vscan /var/db/clamav/

启动clamav。clamav有2个daemon需要启动,一个是用来查病毒的clamd,另外一个是用来更新病毒库的freshclam,他们分别通过如下脚本启动。

shell

# /usr/local/etc/rc.d/clamav-clamd start # /usr/local/etc/rc.d/clamav-freshclam start
 
十三、配置clamav.txt · 最后更改: 2011/09/18 08:19 由 shaobo
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki