服务器搭建手册之FREEBSDUNIX邮件服务器建设(十三)

9、测试病毒过滤。

# telnet localhost 25

Trying ::1…

telnet: connect to address ::1: Connection refused

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.

220 mail.toping.net ESMTP Postfix

mail from:webmaster@toping.net

250 Ok

rcpt to:webmaster@toping.net

250 Ok

data

354 End data with <CR><LF>.<CR><LF>

Subject:Virus test

X5O!P%@AP[4\PZX54(P^)7CC]7]$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

.

250 Ok: queued as F0C221CC20        //出现F0C221CC20这行表示mailscanner运行成功

quit

221 Bye

Connection closed by foreign host.

如图:

10、把病毒提示信息改为中文

预设系统提示信息为英文,可以下载修改的中文包。

通过搜索引擎搜索cn.rar 并下载。

注:把下载下来的文件解压后放到/usr/local/share/MailScanner/reports/cn下面去

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

 

#%report-dir% = /usr/local/share/MailScanner/reports/en  //默认值(加载英文)

 

%report-dir% = /usr/local/share/MailScanner/reports/cn  //修改后为读取中文

 

11、用MailScanner来监管进出邮件

这里为略

12、安装APF防垃圾邮件.

A、用/cute-ftp等FTP上传工具将apf.rar上传到/usr/local/www/apache22/data/

B、复制apf.rar到/usr/local/etc/postfix目录

#cp /usr/local/www/apache22/data/apf.rar /usr/local/etc/postfix/

C、解压apf.rar

#/usr/local/bin/unrar x apf.rar

这时/usr/local/etc/postfix目录里边有一个apf-posftix.pl的文件

D、修改/usr/local/etc/postfix/master.cf

# vi /usr/local/etc/postfix/master.cf

加入:

apf  unix –        n       n       –       –       spawn

 

user=nobody argv=/usr/bin/perl /usr/local/etc/postfix/apf-postfix.pl

 

 

修改/usr/local/etc/postfix/main.cf

 

#vi /usr/local/etc/postfix/main.cf

 

把下面一行注释掉

 

#smtpd_recipient_restrictions = permit_sasl_authenticated permit_auth_destination reject

 

加入下面一行到上面注释掉那一行的下边

 

smtpd_recipient_restrictions =  reject_non_fqdn_sender  permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_policy_service unix:private/apf  reject_unknown_recipient_domain

 

 

以下文章点击率最高

Loading…

     

如果这文章对你有帮助,请扫左上角微信支付-支付宝,给于打赏,以助博客运营

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注