十六、安装clamav
1、安装clamav的支持
从早期的clamav-0.96 就需要zlib-1.2.2以上的版本的支持,我们用的版本是clamav-0.98而centos5上的版本为zlib-1.2.3因此不需要升级,但是为了确保,最好还是确认下:
[root@mail sourcepack]# rpm -qa |grep zlib
zlib-devel-1.2.3-4.el5
zlib-1.2.3-4.el5
如果不是最新的,请使用yum update zlib进行升级。
2、安装clamav ,添加clamav 运行所需的组和用户
[root@mail sourcepack]# groupadd clamav
[root@mail sourcepack]# useradd -g clamav-s /sbin/nologin -M clamav
添加配合amavisd-new使用的用户amavis
[root@mail sourcepack]# groupadd amavis
[root@mail sourcepack]# useradd -g amavis-s /sbin/nologin -M amavis
[root@mail clamav-0.98]# tar -zxvfclamav/clamav-0.98.tar.gz -C ../installpack/
[root@mail installpack]# cd clamav-0.98/
./configure --prefix=/usr/local/clamav--with-dbdir=/usr/local/clamav/share
--sysconfdir=/etc/clamav
[root@mail clamav-0.98]# make
[root@mail clamav-0.98]# make check
[root@mail clamav-0.98]# make install
3、配置Clam AntiVirus 配置文件和更新文件
[root@mail clamav-0.98]# cd /etc/clamav/
[root@mail clamav]# ll
total 64
-rw-r--r-- 1 root root 17348 Oct3 19:35 clamd.conf
-rw-r--r-- 1 root root 17348 Oct3 19:35 clamd.conf.sample
-rw-r--r-- 1 root root8627 Oct3 19:35 freshclam.conf
-rw-r--r-- 1 root root8627 Oct3 19:35 freshclam.conf.sample
(1)、编辑主配置文件:
#vi /etc/clamav/clamd.conf
注释掉第八行的Example,如下:
# Example
找到如下行
#LogFile /tmp/clamd.log
#PidFile /var/run/clamd.pid
LocalSocket /tmp/clamd.socket
#DatabaseDirectory /var/lib/clamav
#User clamav
修改为:
LogFile /var/log/clamav/clamd.log
PidFile /var/run/clamav/clamd.pid
LocalSocket/var/run/clamav/clamd.socket
DatabaseDirectory/usr/local/clamav/share
User amavis
启用以下选项
LogSyslog yes
LogFacility LOG_MAIL
LogVerbose yes
StreamMaxLength 20M(后面的数值应该与邮件服务器允许的最大附件值相一致)
root@mailclamav]# cat clamd.conf |grep -v '^#'|grep -v '^$'
LogFile/var/log/clamav/clamd.log
LogSyslogyes
LogFacilityLOG_MAIL
LogVerboseyes
PidFile/var/run/clamav/clamd.pid
DatabaseDirectory/usr/local/clamav/share
LocalSocket/var/run/clamav/clamd.socket
StreamMaxLength20M
Useramavis
(2)、编辑更新进程的配置文件freshclam.conf
注释掉Example,如下:
#Example
找到如下行
#DatabaseDirectory /var/lib/clamav
#UpdateLogFile /var/log/freshclam.log
分别修改为:
DatabaseDirectory/usr/local/clamav/share
UpdateLogFile/var/log/clamav/freshclam.log
启用以下选项:
DatabaseMirrordb.CN.clamav.net
DatabaseMirrordb.XY.clamav.net
LogSyslogyes
LogFacilityLOG_MAIL
LogVerboseyes
[root@mailclamav]# cat freshclam.conf |grep -v '^#'|grep -v '^$'
DatabaseDirectory/usr/local/clamav/share
UpdateLogFile/var/log/clamav/freshclam.log
LogVerboseyes
LogSyslogyes
LogFacilityLOG_MAIL
DatabaseMirrordb.CN.clamav.net
DatabaseMirrordatabase.clamav.net
4、建立日志所在的目录、进程与socket所在的目录,并让它属于clamav用户:
# mkdir -v /var/log/clamav
# chown -R amavis.amavis /var/log/clamav
# mkdir -v /var/run/clamav
# chmod 700 /var/run/clamav
# chown -R amavis.amavis /var/run/clamav
建立日志文件
#touch/var/log/clamav/freshclam.log
#chownclamav.clamav/var/log/clamav/freshclam.log
5、配置crontab,让ClamAntiVirus每天凌晨更新新的病毒库:
# crontab -e
添加:
0 0 * * * /usr/local/clamav/bin/freshclam
6、配置库文件搜索路径:
# echo “/usr/local/clamav/lib”>>/etc/ld.so.conf
# ldconfig
7、配置clamav开机自动启动
# echo"/usr/local/clamav/sbin/clamd" >>/etc/rc.local
8、启动
[root@mail bin]# /usr/local/clamav/sbin/clamd
如果出现在启动clamav时如下错误,则是clamav对应的库share文件没有clamav权限所致
root@mail local]# /usr/local/clamav/sbin/clamd
LibClamAV Error: cli_loaddb(): No supported database files found in/usr/local/clamav/share
ERROR: Can't open file or directory
Closing the main socket.
[root@mail local]# /usr/local/clamav/bin/freshclam -v
Current working dir is /usr/local/clamav/share
Max retries == 3
ERROR: Can't create temporary directory
/usr/local/clamav/share/clamav-288616288daea774f13acfc7a370b512.tmp
Hint: The database directory must be writable for UID 1002 or GID 1003
解决方法https://wiki.archlinux.org/index.php/ClamAV
[root@mail clamav]# id clamav
uid=1002(clamav) gid=1003(clamav) groups=1003(clamav)
[root@mail clamav]# chown clamav.clamav share/
[root@mail clamav]# ll
total 20
drwxr-xr-x 2 rootroot4096 Oct5 16:18 bin
drwxr-xr-x 2 rootroot4096 Oct5 16:18 include
drwxr-xr-x 3 rootroot4096 Oct5 16:18 lib
drwxr-xr-x 2 rootroot4096 Oct5 16:18 sbin
drwxr-xr-x 3 clamav clamav 4096 Oct12 00:00 share
[root@mail local]# /usr/local/clamav/bin/freshclam -v
Current working dir is /usr/local/clamav/share
Max retries == 3
ClamAV update process started at Thu Oct3 21:03:25 2013
Using IPv6 aware code
Querying current.cvd.clamav.net
TTL: 1091
Software version from DNS: 0.98
Retrieving http://db.CN.clamav.net/main.cvd
Trying to download http://db.CN.clamav.net/main.cvd (IP: 202.118.1.40)
Downloading main.cvd [ 92%]
.............
更新后在启动
[root@mail local]# /usr/local/clamav/sbin/clamd
9、手动更新病毒库命令
#/usr/local/clamav/bin/freshclam
[root@maillocal]# /usr/local/clamav/bin/freshclam
ClamAVupdate process started at Thu Oct321:06:36 2013
main.cvd isup to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cvd isup to date (version: 17931, sigs: 401498, f-level: 63, builder: neo)
bytecode.cvdis up to date (version: 226, sigs: 43, f-level: 63, builder: neo)
总结:安装clamav要安装最新的版本,不然会提示clamav 杀毒引擎过期;本文版本为0.98版本
[root@mailclamav]# /usr/local/clamav/bin/clamscan //
扫描测试
/etc/clamav/clamd.conf:OK
/etc/clamav/clamd.conf.sample:OK
/etc/clamav/freshclam.conf.sample:OK
/etc/clamav/freshclam.conf:OK
-----------SCAN SUMMARY -----------
Knownviruses: 2820461
Engineversion: 0.98
Scanneddirectories: 1
Scannedfiles: 4
Infectedfiles: 0
Datascanned: 0.09 MB
Data read:0.05 MB (ratio 2.00:1)
Time: 9.961 sec(0 m 9 s)
十七、安装SpamAssassin-3.3.1
1
、依赖关系的解决,安装Spamassassin需要很多perl模块的支持,以下是所需模块列表及安装方法;必须的软件包:
Digest::SHA1
HTML::Parser
Net::DNS
LWP (akalibwww-perl)
HTTP::Date
IO::Zlib
Archive::Tar
安装完毕最好在检查一下
cpan>install Digest::SHA1
Digest::SHA1is up to date.
cpan>install HTML::Parser
HTML::Parseris up to date.
cpan>install Net::DNS
Net::DNS isup to date.
cpan>install LWP
LWP is up todate.
cpan>install HTTP::Date
HTTP::Dateis up to date.
cpan>install IO::Zlib
IO::Zlib isup to date.
cpan> installArchive::Tar
Archive::Taris up to date.
说明都已经安装完毕了
可选的软件包,其中有些后面的amavisd也有可能会用到:
MIME::Base64
DB_File
Net::SMTP
Mail::SPF
//
安装不成功要手动安装
Cannot chdir() back to/root/.cpan/build/Mail-SPF-v2.9.0: No such file or directory at Makefile.PLline 26.
Running make test
Make had someproblems, maybe interrupted? Won't test
Running make install
Make had someproblems, maybe interrupted? Won't install
IP::Country::Fast
Net::Ident
IO::Socket::INET6
IO::Socket::SSL
Compress::Zlib
Time::HiRes
Mail::DKIM
Mail::DomainKeys
DBI *and* DBD driver/modules
Encode::Detect
Apache::Test
Razor2
推荐使用CPAN自动安装(你的主机要能连上Internet),它能够自动下载安装,并能解决安装过程中的依赖关系。您可以使用类同的以下的命令来进行安装:
#perl -MCPAN-e shell
cpan>install Digest::SHA1
………………
如果您的主机无法直接连接到Internet,您也可以到http://search.cpan.org上搜索下载所需要的软件包,而后使用类同的下列命令安装:
#tar zxvf
软件包.tar.gz
#cd
软件包
#perlMakefile.PL
#make
#make test
#makeinstall
说明:某些软件包安装的过程中可能需要已经列出的其它软件包的支持(可以先尝试安装Spamassassin,然后按提示补充所需软件包),请安照提示自行调整安装顺序。另外,其中有个软件包安装过程中可能要求声明环境变量LC_ALL,此时,可输入如下命令,并重新进行软件包的编译安装即可。
#exportLC_ALL=C
[[email protected]]# tar jxvf
Mail-SpamAssassin-3.3.1.tar.bz2-C ../installpack/
# cd Mail-SpamAssassin-3.3.1/
# perl Makefile.PL
.......
REQUIRED module missing: NetAddr::IP
optional module missing: Mail::SPF
optional module missing: IP::Country
optional module missing: Razor2
optional module missing: IO::Socket::INET6
optional module missing: Mail::DKIM
warning: some functionality may not beavailable,
please read the above report beforecontinuing!
#######################
domain signature. Version 0.37 or later isneeded to fully support ADSP.
缺少这么多模块。用cpan 逐个的安装;有的安装不不成功就到
http://search.cpan.org/~toddr/Razor2-Client-Agent-2.84/上面下载相关的模块;
optional module missing: IO::Socket::INET6
#cd IO-Socket-INET6-2.71/
[root@mailmodel]# tar -zxvf IO-Socket-INET6-2.71.tar.gz -C ../../installpack/
[email protected]]# perl Makefile.PL
[[email protected]]# make
[email protected]]# make install
optional module missing: Mail::DKIM
[root@mailmodel]# tar -zxvf Mail-DKIM-0.40.tar.gz -C ../../installpack/
#cd Mail-DKIM-0.40/
#perl Makefile.PL
#make
#make install
warning: some functionality may not beavailable,
please read the above report beforecontinuing!
上述模块安装完毕在运行一下
[[email protected]]# perl Makefile.PL
What email address or URL should be used inthe suspected-spam report
text for users who want more information onyour filter installation?
(In particular, ISPs should change this toa local Postmaster contact)
default text: [the administrator of thatsystem]
NOTE: settings for "make test"are now controlled using "t/config.dist".
See that file if you wish to customise whattests are run, and how.
checking module dependencies and theirversions...
Generating a GNU-style Makefile
Writing Makefile for Mail::SpamAssassin
Writing MYMETA.yml and MYMETA.json
Makefile written by ExtUtils::MakeMaker6.78
#make
#make install
2、编辑主配置文件
#vi /etc/mail/spamassassin/local.cf
required_hits 10.0
#rewrite_subject1//这个要注释掉,不然在检查配置文件时提示出错;
required_score 5.0
rewrite_header Subject *****SPAM*****
report_safe 1
use_bayes 1
bayes_auto_learn 1
skip_rbl_checks 1
use_razor2 0
use_pyzor 0
ok_locales all
[root@mail spamassassin]# cat local.cf|grep -v '^#'|grep -v '^$'
rewrite_headerSubject *****SPAM*****
//在已经判定的垃圾邮件之标题加上标记,由于和amavisd想结合的,这里不起作用,起作用的是amavisd.conf中的第142行的 $sa_spam_subject_tag ='***SPAM*** ';
report_safe1//要如何处理垃圾邮件,如果邮件还要经过防病毒扫描处理要设置为0
required_score 5.0
use_bayes1//使用贝叶斯学习系统
bayes_auto_learn1//开启贝叶斯自动学习功能
ifpluginMail::SpamAssassin::Plugin::Shortcircuit
endif #Mail::SpamAssassin::Plugin::Shortcircuit
required_hits6.2//得分多少以上就会判定为垃圾邮件,这个值应该和
amavisd.conf里面的$sa_tag2_level_deflt =6.2;对应的
skip_rbl_checks1//略过RBLs检查,一个互联网反垃圾邮件的组织
use_razor20//使用razor version 2
use_pyzor0//使用przor这两个都是反垃圾邮件组织,怎么判断垃圾邮件
ok_localesall//
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//针对中文的邮件进行一些设置防止误判
header__FROM_TEATIME Received =~ /from mail.x.x/i //域名
header__FROM_TEATIME_IP Received =~ /[ x.x.x.x] /与域名相对应的ip地址
metaFROM_TEATIME_BUT_IP_ERROR (__FROM_TEATIME)
describeFROM_TEATIME_BUT_IP_ERROR From mail.beijihu.cn but ip not match
scoreFROM_TEATIME_BUT_IP_ERROR 8//配置域名和IP不符合,以为垃圾邮件
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//修改记分值防止误判
3、测试spamassassin,进入到原代码包
[root@mail Mail-SpamAssassin-3.3.1]# pwd
/usr/local/src/installpack/Mail-SpamAssassin-3.3.1
[root@mail Mail-SpamAssassin-3.3.1]#spamassassin -t < sample-nonspam.txt > nonspam.out
config: no rules were found!Do you need to run 'sa-update'? at/usr/bin/spamassassin line 403
如果出现:
config:!?no rules were found Do you need to run 'sa-update' at / usr / bin /spamassassin line 403.
解决方法:
yum-y install gnupg
或者
wgetftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.10.tar.gz
#tarxvfz gnupg-1.4.10.tar.gz
#cdgnupg-1.4.10
#./configure&& make
#sudomake install
#sudosa-update
我这里已经安装了gnupg 使用下面的命令即可
[[email protected]]# sa-update
[[email protected]]# spamassassin -t < sample-nonspam.txt >nonspam.out
Oct4 14:39:10.292 [13606] warn: config: created user preferences file:
/root/.spamassassin/user_prefs
[root@mail Mail-SpamAssassin-3.3.1]#spamassassin -t < sample-spam.txt > spam.out
4、查看测试结果:
#less nonspam.out
#less spam.out
5、检查配置文件
#spamassassin -d --lint
如果出现下面的问题[root@mail spamassassin]# spamassassin-d --lint
Oct4 14:57:06.388 [13662] warn: config: failedto parse line, skipping, in
"/etc/mail/spamassassin/local.cf":rewrite_subject 1
把上面的rewrite_subject 1注释掉
正常时无任何信息输出
# spamassassin -d --lint
6、启动进程,并将其加入到自动启动队列
#/usr/bin/spamd -d
#echo "/usr/bin/spamd -d">> /etc/rc.local
7、启动进程,并将其加入到自动启动队列
#/usr/bin/spamd -d
#echo "/usr/bin/spamd -d">> /etc/rc.loca
十八、安装amavisd-newhttp://www.amavis.org/下载
1、依赖关系的解决
以下为官方声明所必须的软件包列表,使用perl -MCPAN -e shell进行安装
Archive::Zip
Compress::Zlib
Convert::TNEF
Convert::UUlib
MIME::Base64
MIME::Parser
Mail::Internet
Net::Server
Digest::MD5
IO::Stringy
Time::HiRes
Unix::Syslog
BerkeleyDB
有些可能在上面已经安装,但是为了保险起见,还是建议逐个验证一遍。
如果有安装不上的可以手动下载安装:
发现只有一个Net::Server安装不了
[root@mail model]# tar zxvf Net-Server-2.007.tar.gz-C ../../installpack/
[root@mail model]# cd ../../installpack/
[root@mail installpack]# cdNet-Server-2.007/
[root@mail Net-Server-2.007]# make
[root@mail Net-Server-2.007]# make install
cpan> install Net::Server
Net::Server is up to date.
所有的模块都安装完毕
2、创建运行时目录,并赋予amavis用户(前文中所建)
# mkdir -pv /var/amavis/{tmp,var,db,home}
# chown -R amavis:amavis /var/amavis
#chmod -R 750 /var/amavis
3、安装amavisd-new-2.6.6
[root@mail sourcepack]# tar -zxvfamavisd-new-2.6.6.tar.gz -C ../installpack/
[root@mail sourcepack]# cd ../installpack/
[root@mail installpack]# cdamavisd-new-2.6.6/
拷贝服务端至$PATH中指定的目录,推荐拷贝至/usr/local/sbin:
[root@mail amavisd-new-2.6.6]# cp amavisd/usr/local/sbin/
[root@mail amavisd-new-2.6.6]# chown root/usr/local/sbin/amavisd
[root@mail amavisd-new-2.6.6]# chmod 755/usr/local/sbin/amavisd
拷贝主配置文件至/etc,并修改相应的权限:
# cp amavisd.conf /etc/
# chown root /etc/amavisd.conf
# chmod 644 /etc/amavisd.conf
创建amavisd运行中所需要的隔离区域:
# mkdir /var/virusmails
# chown amavis:amavis /var/virusmails
# chmod 750 /var/virusmails
4、编辑主配置文件
#vi /etc/amavisd.conf
确保您的如下选项的值如下文所示:
$daemon_user= 'amavis';
$daemon_group = 'amavis';
$mydomain = 'test.com'; (此处可更改为自己的DNS域)
$virus_admin="postmaster/@$mydomain";
$mailfrom_notify_admin= "postmaster/@$mydomain";
$mailfrom_notify_recip= "postmaster/@$mydomain";
$mailfrom_notify_spamadmin ="postmaster/@$mydomain";
$mailfrom_to_quarantine = '';
virus_admin_maps =>["postmaster/@$mydomain"] (指定报告病毒和垃圾邮件时发送系统邮件的用户身份)
spam_admin_maps=> ["postmaster/@$mydomain"]
启用ClamAV,(大概在第363行)去掉如下行前的注释符:
#['ClamAV-clamd',
#/&ask_daemon, ["CONTSCAN {}/n", "/var/run/clamav/clamd"],
# qr//bOK$/, qr//bFOUND$/,
#qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
#['Mail::ClamAV', /&ask_clamav, "*", [0], [1],qr/^INFECTED: (.+)/],---在375行
并将如上行中的/var/run/clamav/clamd修改为:/var/run/clamav/clamd.socket
5、测试启动
[root@mail amavisd-new-2.6.6]#/usr/local/sbin/amavisd
遇到错误
fetch_modules:error loading optional module MIME/Decoder/BinHex.pm:
Can't locate Convert/BinHex.pm in @INC (@INCcontains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/usr/lib/perl5/5.8.8) at
/usr/lib/perl5/site_perl/5.8.8/MIME/Decoder/BinHex.pmline 45.
BEGIN failed--compilation aborted at/usr/lib/perl5/site_perl/5.8.8/MIME/Decoder/BinHex.pm line 45.
Compilation failed in require at/usr/local/sbin/amavisd line 197.
[root@mail model]# tar zxvfConvert-BinHex-1.119.tar.gz -C ../../installpack/// 需要下载
Convert-BinHex-1.119.tar.gz,安装后再启动。
[root@mail installpack]# cdConvert-BinHex-1.119/
#perl Makefile.PL
#make
#make install
[root@mail Convert-BinHex-1.119]#/usr/local/sbin/amavisd
The amavisd daemon is already running, PID:[16590]
十九、配置postfix,让它能调用amavisd,以实现病毒及垃圾邮件的过滤
1、配置/etc/postfix/master.cf
#vi /etc/postfix/master.cf
在文末添加如下内容:
#==========================================================================
# service typeprivate unprivchrootwakeupmaxproc command + args
#(yes) (yes) (yes) (never) (100)
# ==========================================================================
#
amavisfeed unix --n-2smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
#
127.0.0.1:10025 inet n - n--smtpd
-o content_filter=
-o smtpd_delay_reject=no
-osmtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-osmtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8,192.168.0.0/16
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-oeceive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
-o local_header_rewrite_clients=
说明:注意每行“-o”前的空格;
2、修改/etc/postfix/main.cf
#vi /etc/postfix/main.cf
在文末添加如下行:
content_filter=amavisfeed:[127.0.0.1]:10024
3、让postfix重新加载主配置文件,并查看启动情况
# postfix reload && tail -f/var/log/maillog
Oct4 16:42:59 mail postfix/postfix-script[16730]: refreshing the Postfixmail system
Oct4 16:42:59 mail postfix/master[3106]: reload -- version 2.8.15,configuration /etc/postfix
4、查看amavisd是否在监听10024端口,并测试服务启动情况:
[root@mail etc]# netstat -anlt |grep10024
tcp00 127.0.0.1:100240.0.0.0:*LISTEN
[root@mail etc]# telnet localhost 10024
Trying 127.0.0.1...
Connected to localhost.localdomain(127.0.0.1).
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new serviceready
ehlo localhost
250-[127.0.0.1]
250-VRFY
250-PIPELINING
250-SIZE
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 XFORWARD NAME ADDR PORT PROTO HELOSOURCE
quit
221 2.0.0 [127.0.0.1] amavisd-new closingtransmission channel
Connection closed by foreign host.
5、postfix重新加载配置文件后将授权并激活"127.0.0.1:10025"端口,一个正常的服务连接应该类同下面所示:
[root@mail etc]# telnet localhost 10025
Trying 127.0.0.1...
Connected to localhost.localdomain(127.0.0.1).
Escape character is '^]'.
220 mail.beijihu.com ESMTP Postfix (2.8.15)
ehlo localhost
250-mail.beijihu.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host
6、通过amavisd测试发信
[root@mail ~]# telnet localhost 10024
Trying 127.0.0.1...
Connected to localhost.localdomain(127.0.0.1).
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new serviceready
HELO localhost
250 [127.0.0.1]
MAIL FROM:<>
250 2.1.0 Sender <> OK
RCPT TO:<test1>
250 2.1.5 Recipient <test1> OK
DATA
354 End data with<CR><LF>.<CR><LF>
<test1>
From:Anti-Virus tester
To: MailServer Admin
Subject:amavisd test!
amavisd test!!
.
250 2.0.0 Ok, id=03288-01, fromMTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 15A32663958
quit
221 2.0.0 [127.0.0.1] amavisd-new closingtransmission channel
Connection closed by foreign host.
7、使用EXTmail登陆lyf用户查看邮件的情况,如果收到则说明功能正常,收到邮件