构建反病毒反垃圾邮件系统(六)_Mail服务器教程
安装四个下载的软件包:
# dpkg -i *.deb 修改/etc/amavis/amavisd.conf: @inet_acl = qw( 127/8 1.2.3.4/32 ); # 1.2.3.4 is your external ip .. because want maybe also accept mail from that interface, it's up to you. 指定使用uvscan: @av_scanners = ( ['NAI McAfee AntiVirus (uvscan)', 'uvscan', ); 找到/etc/postfix/master.cf如下行: smtp inet n - n - - smtpd 改为如下: smtp inet n n n - - smtpd -o content_filter=smtp-amavis:[127.0.0.1]:10024 重启postfix,这样在收到病毒邮件的时候能够在日志文件看到如下的信息: Jul 16 15:34:22 xxx amavis[30997]: (30997-09) INFECTED (W32/Nimda.gen@MM), (?) -> <xxx@xxx.org>, quarantine virus-20030716-153422-30997-09, Message-ID: <20030716073414.520D3E5C2F@xxx> 三、防垃圾邮件部分 垃圾邮件的防范必须掌握好尺度,postfix本身提供了header_check、body_check、access、classes等方式来拒绝邮件,可以参考如下地址的样例,结合自己的情况进行修改也能阻止一部分垃圾邮件: http://www.XXXX.com/guides/postfix_uce_header.html 不过以上配置文件需要管理员根据自己情况手工进行修改,如果直接采用的话,那么国内很多邮件你将收不到。 1、SpamAssassin的安装 由于已经安装了AMaViS,所以自然就选择了SpamAssassin。SpamAssassin可以通过CPAN安装: # perl -MCPAN -e shell 2、SpamAssassin配置 创建/var/lib/amavis/.spamassassin/user_prefs文件: # SpamAssassin config file for version 2.5x # How many hits before a message is considered spam. # Whether to change the subject of suspected spam # Text to prepend to subject if rewrite_subject is used # Encapsulate spam in an attachment # Use terse version of the spam report # Enable the Bayes system # Enable Bayes auto-learning # Enable or disable network checks # Mail using languages used in these country codes will not be marked # Mail using locales used in these country codes will not be marked |
- 相关链接:
- 教程说明:
Mail服务器教程-构建反病毒反垃圾邮件系统(六)
。