一、防垃圾邮件及防病毒软件安装的介绍
一般来说,从广域网传到我们的服务器上的邮件,经过服务器的postfix 直接传给用户,并不做任何处理。这样会使我们的服务器很不安全,我们的邮件系统成了公用的邮件引擎。
现在我们利用 Amavisd-new(内容过滤)引擎 来做防病毒及防垃圾邮件处理。
过程说明:
广域网发过来的邮件同样会交给postfix 引擎处理,但是我们配置了Amavisd-new 内容过滤引擎,邮件会按照箭头指向流动,Amavisd-new首先会把邮件交给clamd 处理,clamd会检查邮件及其附录内容是否包含病毒,如果检查有病毒,clamd会把邮件放到一个病毒目录下面,并且向病毒邮件管理员(virusalert@mediawoz.cn)发信,说:您收到一份病毒邮件,同时把病毒邮件放到/var/virusmails/。如果邮件没有病毒,clamd会重新把邮件发给Amavisd-new过滤器;Amavisd-new过滤器再把邮件交由spamd 处理,spamd会检查邮件是否为垃圾邮件,这里有N种对垃圾邮件的处理方式,在spmad 里有配置。配置spmad会详细介绍。如果不是垃圾邮件,spamd 会再次把邮件发给Amavisd-new,此时Amavisd-new会把过滤的结果传给postfix,在经过postfix交给用户。
下面我们开始配置。
二、postfix的配置
因为postfix会把邮件交由Amavisd-new处理。所以我们要在/etc/postfix/main.cf里做相应的修改。在上次配置好的main.cf 中添加两行
[iyunv@mail postfix]# vi/etc/postfix/main.cf
#======================= content filter=====================
soft_bounce=yes
content_filter =smtp-amavis:[127.0.0.1]:10024
添加下面的文件内容
[iyunv@mail postfix]# vi/etc/postfix/master.cf
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5master").
#==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
#==========================================================================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes
# -o smtpd_sasl_auth_enable=yes
# -osmtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -osmtpd_client_restrictions=permit_sasl_authenticated,reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
# When relaying mail as backup MX, disable fallback_relay to avoid MXloops
relay unix - - n - - smtp
# -o smtp_helo_timeout=5 -osmtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man pagefor information about ${recipient}
# and other message envelope options.
# ====================================================================
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
maildrop unix - n n - - pipe
flags=DRhu user=postfixargv=/usr/local/bin/maildrop -d ${recipient}
# The Cyrus deliver program has changed incompatibly, multiple times.
old-cyrus unix - n n - - pipe
flags=R user=cyrusargv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver-e -r ${sender} -m ${extension} ${user}
# See the Postfix UUCP_README file for configuration details.
flags=Fqhu user=uucp argv=uux -r-n -z -a$sender - $nexthop!rmail ($recipient)
# Other external delivery methods.
ifmail unix - n n - - pipe
flags=F user=ftnargv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=fooargv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
# interface used to communicate with amavisd-new
smtp-amavis unix - - n - 2 smtp
-osmtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - n - - smtpd
-osmtpd_restriction_classes=
-osmtpd_client_restrictions=
-o smtpd_helo_restrictions=
-osmtpd_sender_restrictions=
-osmtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-ostrict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-osmtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
三、clamd 的配置
1、所需要的软件包
视频:http://www.boobooke.com/v/bbk1106/
下载地址
http://www.rpmfind.net/linux/rpm2html/search.php?query=clamav-db // clamav-db
http://www.rpmfind.net/linux/rpm2html/search.php?query=clamd // clamd
http://fr2.rpmfind.net/linux/rpm2html/search.php?query=clamav // clamav
[iyunv@mail postfix]# ls –l
-rw-r--r-- 1 root root 2763940 Feb 4 14:29 clamav-0.95.3-1.el4.rf.i386.rpm
-rw-r--r-- 1 root root 23781899 Feb 4 14:38 clamav-db-0.95.3-1.el4.rf.i386.rpm
-rw-r--r-- 1 root root 209763 Feb 4 14:21 clamd-0.95.3-1.el4.rf.i386.rpm
[iyunv@mail postfix]# rpm -iclamav-0.95.3-1.el4.rf.i386.rpm
[iyunv@mail postfix]# rpm -iclamav-db-0.95.3-1.el4.rf.i386.rpm
[iyunv@mail postfix]# rpm -iclamd-0.95.3-1.el4.rf.i386.rpm
注:在配置clamd之前要确保你的电脑能上网,需要配置你的网管,DNS。否则病毒库不能更新。
确保机器能上网之后,我们来配置clamd相关文件
主要配置文件为/etc/clamd.conf
[iyunv@mail etc]# cd /etc/
[iyunv@mail etc]# vi clamd.conf
这个文件里的内容一般不做修改,我们只要默认就够用了,下面我介绍几个参数,以便以后增强病毒过滤时做修改
ScanOLE2 //打开OFFICE文档扫描
ScanMail //打开邮件扫描
ScanArchive //扫描压缩包
ArchiveMaxFileSize 10M 最大扫描压缩包为10M,大于10M不扫描
ArchiveMaxRecursion 8 扫描压缩包8层,只扫描1~8层。8层以上的文件内容不扫描
ArchiveMaxFiles 1000 最多扫描压缩包内1000个文件
[iyunv@mail etc]# cd /etc/cron.daily/
[iyunv@mail cron.daily]# ls
00-logwatch 00-makewhatis.cron 0anacron freshclam hichina logrotate prelink rpm slocate.cron tmpwatch yum.cron
[iyunv@mail cron.daily]# sh -x freshclam //更新病毒库
在/etc 下面有很多cron的目录
[iyunv@mail etc]# ls cron*
cron.deny crontab
cron.d:
cron.daily:
00-logwatch 00-makewhatis.cron 0anacron freshclam hichina logrotate prelink rpm slocate.cron tmpwatch yum.cron
cron.hourly:
hichina
cron.monthly:
0anacron
cron.weekly:
00-makewhatis.cron 0anacron yum.cron
[iyunv@mail etc]#
如果把freshclam这个脚本放到不同的目录下面,就会不同的时间去更新病毒库。
如:放到cron.monthly下面,就每个月更新一次。默认在cron.daily下面。
病毒更新的日志会在 /var/log/clamav/freshclam.log
[iyunv@mail etc]# chkconfig clamd on // 开机自启动
[iyunv@mail etc]# /etc/init.d/clamd start
[iyunv@mail etc]# vi /var/log/clamav/clamd.log //查看clamd日志
四、splamd 配置
视频:http://www.boobooke.com/v/bbk1108/
下载地址http://dag.wieers.com/rpm/packages/
我们的服务器为 REL4 所以要求软件包
[iyunv@mail ~]# ll
spamassassin-3.1.8-1.el4.rf.i386.rpm
[iyunv@mail postfix]# vi/etc/mail/spamassassin/local.cf
# These values can be overridden by editing~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)
# These should be safe assumptions and allowfor simple visual sifting
# without risking lost emails.
required_hits 18.5 //得分 18.5 以上算是垃圾邮件
report_safe0 //要如何处理垃圾邮件。如果邮件还会经过防毒程序的扫描处理,所以必须设定为0
rewrite_header Subject [SPAM] //在已判定的垃圾邮件的标题加上标记
# Enable the Bayes system
use_bayes 1
# Enable Bayes auto-learning
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 1
# Mail using locales used in these countrycodes will not be marked
# as being possibly spam in a foreignlanguage.
ok_locales zh en
ok_languages zh en
score HEADER_8BITS 0
score HTML_COMMENT_8BITS 0
score SUBJ_FULL_OF_8BITS 0
score UPPERCASE_25_50 0
score UPPERCASE_50_75 0
score UPPERCASE_75_100 0
score NO_REAL_NAME 4.000
score SPF_FAIL 10.000
score SPF_HELO_FAIL 10.000
score BAYES_99 4.300
score BAYES_90 3.500
score BAYES_80 3.000
#header __FROM_TEATIME Received=~/frommail.mediawoz.cn/i
#header __FROM_TEATIME_IPReceived=~/[222.35.138.43]/
#metaFROM_TEATIME_BUT_IP_ERROR(__FROM_TEATIME)
#describe FROM_TEATIME_BUT_IP_ERROR Frommail.mediawoz.cn but ip not match
#score FROM_TEATIME_BUT_IP_ERROR 8
[iyunv@mail postfix]# vi/etc/mail/spamassassin/v310.pre
找到
# TextCat - language guesser
#
#loadpluginMail::SpamAssassin::Plugin::TextCat
去掉注释
# TextCat - language guesser
#
loadpluginMail::SpamAssassin::Plugin::TextCat
//上面是为了匹配local.cf的 ok_languages zh en 一行,否则报错
[iyunv@mail postfix]# chkconfig spamassassinon
[iyunv@mail ~]# /etc/init.d/spamassassin start
Starting spamd: [ OK ]
[iyunv@mail ~]# vi /var/log/maillog //spamd 日志目录
[iyunv@mail ~]# netstat –antp
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 20707/spamd.pid
显示spamd程序成功运行
在网上下载一份Chinese_rules.cf
http://www.ccert.edu.cn/spam/sa/Chinese_rules.cf
这份文件是国内对汉字垃圾邮件判定的一些规则,默认安装的时候都是对英文进行判定,我们在 local.cf 中添加了ok_languages zh en 这一行,所以spamd会检查中文的邮件是否为垃圾邮件。这个邮件每周更新一次,所以我们还要在 crond.weekly目录下添加更新脚本。
[iyunv@mail ~]# cp Chinese_rules.cf /usr/share/spamassassin/
[iyunv@mail ~]# cd /etc/cron.weekly/
[iyunv@mail cron.weekly]# vi Chinese_rules.sh
#!/bin/bash
/usr/bin/wget -N -P /usr/share/spamassassinwww.ccert.edu.cn/spam/sa/Chinese_rules.cf
/etc/rc.d/init.d/spamassassin restart
[iyunv@mail cron.weekly]# chmod 755Chinese_rules.sh
至此spamd垃圾过滤程序完成。
五、amavisd 配置
1、 这个程序需要很多软件包,下面是软件包下载的地址
http://dag.wieers.com/rpm/packages/
确定你的系统里有如下软件包
首先是系统光盘应该有的,装系统时自带的软件包,我们服务器没装,所以我自己手动安装。
如果没有可以去上面那个网站去下载
我自己后安装的软件包有:
[iyunv@mail perl-deflat]# ll
perl-Archive-Tar-1.38-1.el4.rf.noarch.rpm
perl-BSD-Resource-1.2901-1.el4.rf.i386.rpm
perl-Class-Classgen-classgen-3.03-1.el4.rf.noarch.rpm
perl-Compress-Raw-Zlib-2.008-1.el4.rf.i386.rpm
perl-DBD-mysql-4.006-1.el4.rf.i386.rpm //这三个软件包只装一个就行,我没安装 perl-DBD-mysql-4.010-1.el4.rf.i386.rpm // 与数据库版本相关,不好修改。
perl-DBD-MySQL-4.013-2.fc12.i686.rpm
perl-Digest-HMAC-1.01-1.rhel2.1.dag.noarch.rpm //也是版本问题,我装的rhel2
perl-digest-hmac-1.01-66587cl.i386.rpm
perl-Digest-SHA1-2.11-4.el4.pp.i386.rpm
perl-IO-Compress-Base-2.008-1.el4.rf.noarch.rpm
perl-IO-Compress-Zlib-2.008-1.el4.rf.noarch.rpm
perl-IO-Socket-INET6-2.54-1.el4.rf.noarch.rpm
perl-IO-Socket-SSL-1.13-1.el4.rf.noarch.rpm
perl-IO-Zlib-1.09-1.el4.rf.noarch.rpm
perl-Net-DNS-0.63-1.el4.rf.i386.rpm
perl-Net-IP-1.25-1.el4.rf.noarch.rpm
perl-Net-SSLeay-1.32-1.el4.rf.i386.rpm
perl-Socket6-0.20-1.el4.rf.i386.rpm
perl-String-CRC32-1.4-1.el4.rf.i386.rpm
perl-TimeDate-1.16-1.2.el4.rf.noarch.rpm
注:我装包是遇到很多麻烦,比如版本不对,或者安装一个包会有很多依赖关系。
(1)装perl-digest-hmac-1.01-66587cl.i386.rpm的时候
[iyunv@mailperl-deflat]# rpm -i perl-digest-hmac-1.01-66587cl.i386.rpm
error:Failed dependencies:
perl-base = 3:5.8.5 is neededby perl-digest-hmac-1.01-66587cl.i386
所以我用perl-Digest-HMAC-1.01-1.rhel2.1.dag.noarch.rpm来替换
(2)perl-DBD-mysql-4.006-1.el4.rf.i386.rpm 这个软件包至今还没解决,它要求依赖
libmysqlclient.so.14 的依赖,但是我们的mysql 版本是5.1.30 是libmysqlclient.so.16
数据库不能换,里面有很多重要的东西。所以暂时我先放下。
2、安装好以上这些软件包之后先安装perl-File-Temp-0.20-1.el4.rf.noarch.rpm
[iyunv@mail amavisd]# rpm -i --nodocsperl-File-Temp-0.20-1.el4.rf.noarch.rpm
3、安装好这些系统里应该安装的之后。我们还要安装amavisd依赖的一些perl软件包
[iyunv@mail perl]# ls
perl-Archive-Zip-1.23-1.el4.rf.noarch.rpm
perl-BerkeleyDB-0.33-1.el4.rf.i386.rpm
perl-Convert-BinHex-1.119-2.2.el4.rf.noarch.rpm
perl-Convert-TNEF-0.17-3.2.el4.rf.noarch.rpm
perl-Convert-UUlib-1.051-1.2.el4.rf.i386.rpm
perl-IO-stringy-2.110-1.2.el4.rf.noarch.rpm
perl-MailTools-2.02-1.el4.rf.noarch.rpm
perl-MIME-tools-5.425-1.el4.rf.noarch.rpm
perl-Net-Server-0.97-1.el4.rf.noarch.rpm
perl-Unix-Syslog-1.0-1.el4.rf.i386.rpm
[iyunv@mail perl]# rpm -i perl-*
4、安装其他压缩及解压缩软件包
[iyunv@mail amavisd]# rpm -iarc-5.21o-1.el4.rf.i386.rpm cabextract-1.2-1.el4.rf.i386.rpmfreeze-2.5-2.2.el4.rf.i386.rpm lha-1.14i-19.2.2.rf.src.rpmlzo-1.08-4.2.el4.rf.i386.rpm lzop-1.01-2.el4.rf.i386.rpmncompress-4.2.4-41.rhel4.i386.rpm nomarch-1.4-1.el4.rf.i386.rpmunarj-2.63-0.a.2.el4.rf.i386.rpm unrar-3.6.8-1.el4.rf.i386.rpmzoo-2.10-2.2.el4.rf.i386.rpm ripole-0.2.0-1.2.el4.rf.i386.rpm
warning: arc-5.21o-1.el4.rf.i386.rpm: V3 DSAsignature: NOKEY, key ID 6b8d79e6
warning: ncompress-4.2.4-41.rhel4.i386.rpm:V3 DSA signature: NOKEY, key ID db42a60e
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
warning: user dag does not exist - using root
warning: group dag does not exist - usingroot
一些warning先不用去管他
5、安装amavisd
[iyunv@mail amavisd]# rpm -i amavisd-new-2.5.4-1.el4.rf.i386.rpm
warning: amavisd-new-2.5.4-1.el4.rf.i386.rpm:V3 DSA signature: NOKEY, key ID 6b8d79e6
[iyunv@mail amavisd]#
6、配置amavisd
Amavisd的文档目录
root@mail amavisd]# cd /usr/share/doc/amavisd-new-2.5.4/
[iyunv@mail amavisd-new-2.5.4]#ls
AAAREADME.first images README.contributed README.exim_v4 README.old.scanners README.sendmail RELEASE_NOTES
amavisd.conf LDAP.schema README.courier README.exim_v4_app README.performance README.sendmail-dual screen.css
amavisd.conf-default LICENSE README.courier-old README.exim_v4_app2 README.policy-on-notifications README.sendmail-dual.old test-messages
amavisd.conf.orig MANIFEST README.customize README.ldap README.postfix README.sql TODO-SNMP-AGENT
amavisd.conf-sample README.banned README.exim_v3 README.lookups README.postfix.html README.sql-mysql
amavisd-new-docs.html README.chroot README.exim_v3_app README.milter README.protocol README.sql-pg
[iyunv@mail amavisd-new-2.5.4]#vi amavisd.conf-sample
这个文档里有amavisd的详细说明,各个参数的使用都可以找到。
下面我们来配置amavisd
直接改下面的配置文件没有关系,/usr/share/doc/amavisd-new-2.5.4/ 下面有备份
[iyunv@mail amavisd-new-2.5.4]#cd /etc/
[iyunv@mail etc]# vi amavisd.conf
注意以下几个地方,其余地方可以按默认配置
$mydomain = 'mediawoz.cn'; # 改成我们自己的邮件域
$max_servers = 2;
#此处的2 要与/etc/postfix/master.cf 文件里
#smtp-amavis unix - - n - 2 smtpd
#相对应,改一处,则另一处也要修改。
@local_domains_maps= ( [".$mydomain"] );
# 注意,现在我们就一个邮件域,以后要多个邮件域则要把你所有的域名添加到这里。
$final_spam_destiny = D_PASS;
#对垃圾邮件的处理方式
#D_PASS不做任何处理,直接送给收件人
#D_DISCARD直接扔掉,不传送给发件人及收件人
#D_REJECT不传给收件人。发件人会收到拒绝传送的信息
#D_BOUNCE #不传送给收件人,也不给发件人。除了定义在$viruses_that_fake_sender_re
#病毒名称外的信件人,amavisd-new会传送DSN讯息给发件人。
$sa_auto_whitelist= 1; # 打开发件人白名单,如果发件人在白名单里,怎不认为
#是垃圾邮件
$sa_mail_body_size_limit = 200*1024; #超过特定大小的邮件不经过spmad扫描
### 配置垃圾邮件的分值 ###
$sa_tag_level_deflt = 4.0; # 超过这个分数者,才视为垃圾邮件打分数
# 加入X-Spam-Status及X-Spam-Level 信息
$sa_tag2_level_deflt= 18.5; # 超过这个分数者,才允许在邮件标题加入spam信息加入#x-Spam-Flag:YES及改写主题
$sa_kill_level_deflt= 10; # 超过这个分数者,肯定是垃圾邮件了,备份后删除邮件,并发
# 信给垃圾邮件管理员
$sa_dsn_cutoff_level = 9; # 超过这个分数者,将不会发出DSN信息
$sa_spam_subject_tag = '***SPAM*** '; # 在已判定是垃圾邮件标题上加上标记
read_hash(/%whitelist_sender,'/var/amavis/whitelist');
read_hash(/%blacklist_sender,'/var/amavis/blacklist');
找到
['ClamAV-clamd',
/&ask_daemon, ["CONTSCAN {}/n", "/var/run/clamav/clamd.sock"],
qr//bOK$/, qr//bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
把前面的数据去掉,注意红字部分,找到你系统里对应的clamd.sock
[iyunv@mail ~]# touch /var/amavis/whitelist
[iyunv@mail ~]# touch /var/amavis/blacklist
[iyunv@mail ~]# chown amavis:amavis/var/amavis/whitelist
[iyunv@mail ~]# chown amavis:amavis/var/amavis/blacklist
注:登记在whitelist的邮件地址或域名均不会被spamd打分为垃圾邮件
登记在blacklist的邮件地址或域名均会被spamd 视为垃圾邮件
写法每行一个邮件地址或域名
Test@test.com.cn
*@boss.com
修改了这两个文件之后,执行/etc/init.d/amavisd reload 重新读取配置文件,否则不生效。
[iyunv@mail ~]# chkconfig amavisd on
[iyunv@mail ~]# /etc/init.d/amavisd start
Starting Mail Virus Scanner (amavisd): [ OK ]
[iyunv@mail ~]# /etc/init.d/amavisd reload
Reloading Mail Virus Scanner (amavisd):[ OK ]
[iyunv@mail ~]# /etc/init.d/amavisd stop
Shutting down Mail Virus Scanner (amavisd):[FAILED]
[iyunv@mail ~]# /etc/init.d/amavisd start
Starting Mail Virus Scanner (amavisd): [ OK ]
[iyunv@mail ~]#
Amavisd 日志在/var/log/maillog
注:我在安装过程中遇到的N多困难,希望以后的安装者可以借鉴。
======================================================================
Error in processing, id=06353-01-2,mime_decode-1 FAILED: Can't locate object method "seek" via package"File::Temp" at /usr/lib/perl5/vendor_perl/5.8.5/MIME/Parser.pmline 816, <GEN6> line 57. (in reply to end of DATA command)
解决方法
http://www.jumpingbean.co.za/blogs/mark/postfix-amavisd-centos-lost-connection-with
======================================================================
May 19 08:38:53 as3 amavis[1752]:(01752-01) ask_av (ClamAV-clamd) FAILED - unexpected result:/var/spool/vscan/tmp/amavis-20050519T083853-01752/parts: Access denied. ERROR/n
解决方法
http://www.extmail.org/forum/viewthread.php?tid=4865&highlight=
======================================================================
Feb 7 17:56:38 mail amavis[1735]: (01735-02)(!!)TROUBLE in check_mail: mime_decode-1 FAILED: Can't locate object method"binmode" via package "IO::File" at /usr/lib/perl5/vendor_perl/5.8.5/MIME/Body.pmline 437.
Feb 7 17:56:38 mail amavis[1735]: (01735-02)(!)PRESERVING EVIDENCE in /var/amavis/tmp/amavis-20100207T175638-01735
Feb 7 17:56:38 mail postfix/smtp[2135]:AE575C8B7C: to=<lei.chen@mediawoz.cn>, relay=127.0.0.1[127.0.0.1]:10024,delay=0.1, delays=0.03/0/0/0.06, dsn=4.5.0,status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing,id=01735-02, mime_decode-1 FAILED: Can't locate object method"binmode" via package "IO::File" at /usr/lib/perl5/vendor_perl/5.8.5/MIME/Body.pmline 437. (in reply to end of DATA command))
解决方法
[iyunv@mail~]# perl -MCPAN -eshell;
cpan> install IO::File
cpan> quit
[iyunv@mail~]#
cp /root/.cpan/build/IO-1.25/blib/lib/IO/File.pm
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/IO/File.pm
cp: overwrite `/usr/lib/perl5/5.8.5/i386-linux-thread-multi/IO/File.pm'?y
[iyunv@mail ~]#/etc/init.d/amavisd reload
Reloading Mail Virus Scanner(amavisd): [ OK ]
[iyunv@mail ~]#/etc/init.d/amavisd stat
Usage: /etc/init.d/amavisd {start|stop|restart|reload|condrestart|status}
[iyunv@mail ~]#/etc/init.d/amavisd start
Starting Mail Virus Scanner(amavisd): [ OK ]
======================================================================
将clamav加到amavis运行组里,并调整目录权限,否则clamav将无法扫描amavisd-new产生的临时文件
[iyunv@mail~]# gpasswd -a clamavamavis
[iyunv@mail~]# usermod -G amavisclamav
[iyunv@mail~]# chown amavis.amavis/var/spool/vscan
[iyunv@mail~]# chmod 750/var/spool/vscan
[iyunv@mail~]# chown amavis.amavis/var/spool/vscan/tmp
[iyunv@mail~]# chmod 750/var/spool/vscan/tmp
// 后两行无
|