CentOS 5.5下邮件服务器Postfix安装(4)

716 ['ClamAV-clamd',
717   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
718   qr/\bOK$/, qr/\bFOUND$/,
719   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
720 );

724 @av_scanners_backup = (
725
726   ###    - backs up clamd or Mail::ClamAV
727 #  ['ClamAV-clamscan', 'clamscan',
728 #    "--stdout --no-summary -r --tempdir=$TEMPBASE {}",
729 #    [0], qr/:.*\sFOUND$/m, qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],
730 ['ClamAV-clamscan', 'clamscan',
731     "--stdout --no-summary -r --tempdir=$TEMPBASE {}",
732     [0], qr/:.*\sFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],

配置Amavisd与spam结合
14  @bypass_spam_checks_maps  = (\%bypass_spam_checks,\@bypass_spam_checks_acl,\$bypass_spam_checks_re);

配置Postfix 集成amavisd-new
修改/etc/postfix/master.cf添加如下:
smtp-amavis   unix  -       -        n      -        2      smtp   
                -o  lmtp_data_done_timeout=1200    
                -o  lmtp_send_xforward_command=yes 
                -o  disable_dns_lookups=yes
127.0.0.1:10025 inet n  -        n      -        -      smtpd  
                -o content_filter=     
                -o smtpd_client_restrictions=permit_mynetworks,reject  
                -o smtpd_helo_restrictions=    
                -o smtpd_sender_restrictions=  
                -o smtpd_recipient_restrictions=permit_mynetworks,reject   
                -o smtpd_data_restrictions=reject_unauth_pipelining    
                -o mynetworks=127.0.0.0/8
修改 vim /etc/postfix/main.cf文件
content_filter=smtp-amavis:[127.0.0.1]:10024
重启postfix:
service postfix restart
重新启动amavisd:
service amavisd restart
使用thunderbird发送正常邮件测试,
发送垃圾邮件测试,代码:XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
病毒代码:X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
被拒绝的邮件保存在/var/spool/vscan/tmp目录下
日志文件/var/log/maillog

11. 安装FCGI
rpm -ivh httpd-devel-2.2.3-31.el5.i386.rpm
ln -s /usr/lib/httpd/build /etc/httpd
tar xfz mod_fastcgi-2.4.6.tar.gz
# cd mod_fastcgi-2.4.6
# cp Makefile.AP2 Makefile
# make top_dir=/etc/httpd install

除了Apache需要FCGI的支持外,extmail也需要相应的perl-FCGI模块
yum install perl-FCGI-0.67-1.2.el5.rf.i386.rpm

vim /etc/httpd/conf/vhost_extmail.conf
LoadModule fastcgi_module modules/mod_fastcgi.so
<Ifmodule mod_fastcgi.c>
FastCgiExternalServer /usr/bin/dispatch.fcgi -host 127.0.0.1:8888 -idle-timeout 240
</Ifmodule>

<VirtualHost *:80>
ServerName mail.lx.com
DocumentRoot /var/www/extsuite/extmail/html/

#ScriptAlias /extmail/cgi/ /var/www/extsuite/extmail/cgi/
Alias /extmail/cgi/ /usr/bin/dispatch.fcgi/
Alias /extmail /var/www/extsuite/extmail/html/
<Location "/extmail/cgi">
SetHandler fastcgi-script
</Location>

ScriptAlias /extman/cgi/ /var/www/extsuite/extman/cgi/
Alias /extman /var/www/extsuite/extman/html/

重启Apache和fastcgi server开机自启动:

shell

# service httpd restart
# /var/www/extsuite/extmail/dispatch-init start
# echo “/var/www/extsuite/extmail/dispatch-init start” &gt;&gt; /etc/rc.d/rc.local

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/0701b129ce47ffa05152b072c37a541f.html