改动/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. $warnvirussender = 1; # I want to warn people, who have got virus. $warnvirusrecip = 1; # I want to warn my users about virus send to them. $warn_offsite = 1; # I want to warn senders/recipients, that are not located on my server $mailfrom_notify_admin = 'virusalert'; # $mailfrom_notify_recip = 'virusalert'; # Change these to the appropriate email-adresses, you wish to use as sender $mailfrom_notify_spamadmin = 'spam.police'; # for spam and virus warnings $hdrfrom_notify_sender = 'AMaViS (content filter) postmaster $virus_admin = 'virus-admin'; # $spam_admin = 'spam-admin'; #
特定应用uvscan:
@av_scanners = (
['NAI McAfee AntiVirus (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以下行:
smtp inet n - n - - smtpd
改成以下:
smtp inet n n n - - smtpd -o content_filter=smtp-amavis:[127.0.0.1]:10024 smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200 -o disable_dns_lookups=yes 127.0.0.1:10025 inet n - n - - smtpd -o local_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o works,reject -o strict_rfc821_envelopes=yes
重新启动postfix,那样在接到病毒感染电子邮件的情况下可以在系统日志文档见到以下的信息内容:
Jul 16 15:34:22 xxx amavis[30997]: (30997-09) INFECTED (W32/Nimda.gen@MM), (?) - , quarantine virus--30997-09, Message-ID: 14.
三、防废弃物电子邮件一部分
废弃物电子邮件的预防务必把握好限度,postfix自身出示了header_check、body_check、access、classes等方法来回绝电子邮件,能够参照以下详细地址的样例,
但是之上配备文档必须管理方法员依据自身状况手工制作开展改动,假如立即选用得话,那麼中国许多电子邮件你将收不上。
SpamAssassin和AMaViS能够非常好的融合,它可以帮管理方法员全自动解决一些废弃物电子邮件。SpamAssassin很趣味,它对编解码后的电子邮件开展扫描仪后评分,假如成绩做到客户特定的成绩,那麼就觉得是废弃物电子邮件,并且它也有学习培训作用,管理方法员还可以自身再次界定各种各样得分或自定得分。
1、SpamAssassin的安裝
因为早已安裝了AMaViS,因此当然就挑选了SpamAssassin。SpamAssassin能够根据CPAN安裝:
# perl -MCPAN -e shell install Mail::SpamAssassin
2、SpamAssassin配备
建立/var/lib/amavis/.spamassassin/user_prefs文档:
# SpamAssassin config file for version 2.5x # generated by (version 1.01)
# How many hits before a message is considered spam. required_hits 5.0
# Whether to change the subject of suspected spam rewrite_subject 1
# Text to prepend to subject if rewrite_subject is used subject_tag *****SPAM*****
# Encapsulate spam in an attachment report_safe 1
# Use terse version of the spam report use_terse_report 0
# Enable the Bayes system use_bayes 1
# Enable Bayes auto-learning auto_learn 1
# Enable work checks skip_rbl_checks 1 use_razor2 0 0 use_pyzor 0
# Mail using languages used in these country codes will not be marked # as being possibly spam in a foreign language. # - chinese english ok_languages zh en
# Mail using locales used in these country codes will not be marked # as being possibly spam in a foreign language. ok_locales en zh
(责任编辑:admin) |