构建反病毒反垃圾邮件系统(六)

来源:云南设计港 时间:2007-10-08 13:50:00 

安装四个下载的软件包:

#dpkg-i*.deb

修改/etc/amavis/amavisd.conf:
  


  @inet_acl=qw(127/81.2.3.4/32);#1.2.3.4isyourexternalip..becausewantmaybealsoacceptmailfromthatin-terface,it'suptoyou.
  $warnvirussender=1;#Iwanttowarnpeople,whohavegotvirus.
  $warnvirusrecip=1;#Iwanttowarnmyusersaboutvirussendtothem.
  $warn_offsite=1;#Iwanttowarnsenders/recipients,thatarenotlocatedonmyserver
  $mailfrom_notify_admin='virusalert@example.com';#
  $mailfrom_notify_recip='virusalert@example.com';#Changethesetotheappropriateemail-adresses,youwishtouseassender
  $mailfrom_notify_spamadmin='spam.police@example.com';#forspamandviruswarnings
  $hdrfrom_notify_sender='AMaViS(contentfilter)<postmaster@example.com>';
  $virus_admin='virus-admin@example.com';#
  $spam_admin='spam-admin@example.com';#

  
指定使用uvscan:
  


  @av_scanners=(
  
  ['NAIMcAfeeAntiVirus(uvscan)','uvscan',
  '--secure-rv--summary--noboot{}',[0],[13],
  qr/(?x)Found(?:
  \the\(.+)\(?:virus|trojan)|
  \(?:virus|trojan)\or\variant\([^]+)|
  :\(.+)\NOT\a\virus)/],
  
  );

  
找到/etc/postfix/master.cf如下行:

smtpinetn-n--smtpd

改为如下:
  


  smtpinetnnn--smtpd-ocontent_filter=smtp-amavis:[127.0.0.1]:10024
  smtp-amavisunix--n-2smtp
  -osmtp_data_done_timeout=1200
  -odisable_dns_lookups=yes
  127.0.0.1:10025inetn-n--smtpd
  -olocal_recipient_maps=
  -osmtpd_restriction_classes=
  -osmtpd_client_restrictions=
  -osmtpd_helo_restrictions=
  -osmtpd_sender_restrictions=
  -osmtpd_recipient_restrictions=permit_mynetworks,reject
  -ostrict_rfc821_envelopes=yes

  
重启postfix,这样在收到病毒邮件的时候能够在日志文件看到如下的信息:
  


  Jul1615:34:22xxxamavis[30997]:(30997-09)INFECTED(W32/Nimda.gen@MM),(?)-><xxx@xxx.org>,quarantinevirus-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
  http://www.XXXX.com/guides/postfix_uce_body.html
  http://www.XXXX.com/guides/postfix_uce_access.html
  http://www.XXXX.com/guides/postfix_uce_class.html

  
不过以上配置文件需要管理员根据自己情况手工进行修改,如果直接采用的话,那么国内很多邮件你将收不到。

SpamAssassin和AMaViS可以很好的结合,它能够帮管理员自动处理一些垃圾邮件。SpamAssassin很有趣,它对解码后的邮件进行扫描后打分,如果分数达到用户指定的分数,那么就认为是垃圾邮件,而且它还有学习功能,管理员也可以自己重新定义各种分值或自定义分值。

1、SpamAssassin的安装

由于已经安装了AMaViS,所以自然就选择了SpamAssassin。SpamAssassin可以通过CPAN安装:

#perl-MCPAN-eshell

installMail::SpamAssassin

2、SpamAssassin配置

创建/var/lib/amavis/.spamassassin/user_prefs文件:
  


  #SpamAssassinconfigfileforversion2.5x
  #generatedbyhttp://www.yrex.com/spam/spamconfig.php(version1.01)
  
  #Howmanyhitsbeforeamessageisconsideredspam.
  required_hits5.0
  
  #Whethertochangethesubjectofsuspectedspam
  rewrite_subject1
  
  #Texttoprependtosubjectifrewrite_subjectisused
  subject_tag*****SPAM*****
  
  #Encapsulatespaminanattachment
  report_safe1
  
  #Useterseversionofthespamreport
  use_terse_report0
  
  #EnabletheBayessystem
  use_bayes1
  
  #EnableBayesauto-learning
  auto_learn1
  
  #Enableordisablenetworkchecks
  skip_rbl_checks1
  use_razor20
  use_dcc0
  use_pyzor0
  
  #Mailusinglanguagesusedinthesecountrycodeswillnotbemarked
  #asbeingpossiblyspaminaforeignlanguage.
  #-chineseenglish
  ok_languageszhen
  
  #Mailusinglocalesusedinthesecountrycodeswillnotbemarked
  #asbeingpossiblyspaminaforeignlanguage.
  ok_localesenzh

标签:
0
投稿

猜你喜欢

  • 蔡文胜谈4399拒绝与百度合作:担心失去流量

    2010-09-02 12:15:00
  • robots.txt使用技巧

    2008-04-28 13:06:00
  • 百度欲在深设华南总部 作为拓展业务基地

    2009-11-09 08:52:00
  • 如何做一个人气旺的站 我的四个做站经验

    2008-12-23 11:21:00
  • UCenter Home 2.0测试 十大热点道具功能早知道

    2009-07-31 12:09:00
  • 微软发布Windows Phone “商店”中国遇阻

    2009-10-16 11:34:00
  • 互联网产品中的邀请机制

    2009-11-16 12:21:00
  • 淘宝客网站赚钱攻略浅谈

    2010-05-10 18:04:00
  • FTP服务器如何实现安全性(下)

    2007-08-14 15:37:00
  • 中国网游山寨化严重:新游戏3天就被山寨

    2009-10-23 07:48:00
  • GoDaddy Linux空间 相关问题解答

    2010-04-08 13:16:00
  • 登陆页高效优化思路是简单再简单!

    2007-09-23 13:39:00
  • “奥巴马”火爆 百度百科词条访问超百万

    2009-11-20 15:16:00
  • 如何在Discuz!7.0的边栏添加广告

    2009-04-09 12:01:00
  • 美国当前较流行十大Windows主机提供商推荐

    2010-02-28 13:13:00
  • 国际域名涨价已成定局

    2007-09-23 08:00:00
  • php.ini中文版

    2008-02-23 10:12:00
  • 微软出价446亿美元洽购雅虎

    2008-02-02 10:13:00
  • Google再现高管离职潮 近两年离职高管一览

    2009-10-14 14:34:00
  • CISCO PIX防火墙及网络安全配置指南

    2008-08-19 16:51:00
  • asp之家 网站运营 m.aspxhome.com