唐山网站建设

设为主页 加入收藏 繁體中文

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

核心提示:构建反病毒反垃圾邮件系统

安装4个下载的软件包:

#dpkg-i*.deb

修改/etc/amavis/amavisd.conf:
  

以下为援用的内容:
  @inet_acl=qw(127/81.2.3.4/32);#1.2.3.4isyourexternalip..becausewantmaybealsoacceptmailfromthatin-te***ce,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)';
  $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⑵smtp
  -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:22***amavis[30997]:(30997-09)INFECTED(W32/Nimda.gen@MM),(?)-><***@***.org>,quarantinevirus⑵0030716⑴53422⑶0997-09,Message-ID:<20030716073414.520D3E5C2F@***>

  
3、防垃圾邮件部份

垃圾邮件的防范必须掌控好标准,postfix本身提供了header_check、body_check、access、classes等方式来拒尽邮件,可以参考以下地址的样例,结合自己的情况进行修改也能禁止1部份垃圾邮件:
  

以下为援用的内容:
  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可以很好的结合,它能够帮治理员自动处理1些垃圾邮件。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

http://www.fw8.net/


TAG:内容,部份,垃圾邮件,邮件,分数
评论加载中...
内容:
评论者: 验证码: