1.要求利用Linux系统下的Mail服务,能够收发邮件;2.突出邮件服务器的特点,能够用OutLook收发邮件;一.配置DNS1.使用vi/etc/named.conf打开DNS主配文件,然后找到最后一行,并在最后一行上面添加下列内容:zoneyzl.comIN{typemaster;fileyzl.com.zheng;allow-update{none;};};zone1.254.10.in-addr.arpaIN{typemaster;file10.254.1.fan;allow-update{none;};};2.进入/var/named目录,将该目录下的localhost.zone和named.local分别拷贝为yzl.com.zheng和10.254.1.fan,如下:[root@localhostroot]#cd/var/named/[root@localhostnamed]#lslocalhost.zonenamed.canamed.local[root@localhostnamed]#cplocalhost.zoneyzl.com.zheng[root@localhostnamed]#cpnamed.local10.254.1.fan[root@localhostnamed]#ls10.254.1.fanlocalhost.zonenamed.canamed.localyzl.com.zheng然后编辑yzl.com.zheng和10.254.1.fan两个文件,将这两个文件分别改为如下内容:两文件中yzl.com后面的点(.)不可少[root@localhostnamed]#viyzl.com.zheng$TTL86400@1DINSOAyzl.com.root.yzl.com.(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimum1DINNSns.yzl.com.1DINMX5mail.yzl.com.ns1DINA10.254.1.253mail1DINA10.254.1.253[root@localhostnamed]#vi10.254.1.fan$TTL86400@INSOAyzl.com.root.yzl.com.(1997022700;Serial28800;Refresh14400;Retry3600000;Expire86400);MinimumINNSns.yzl.com.253INPTRns.yzl.com.253INPTRmail.yzl.com.3.将/etc/resolv.conf文件中DNS设为本机IP[root@localhostnamed]#vi/etc/resolv.confnameserver10.254.1.253searchlocalhost4.测试DNS,如下图,说明成功。二.配置sendmail1.配置主配文件[root@localhostnamed]#vi/etc/mail/sendmail.cf将#SMTPdaemonoptionsODaemonPortOptions=Port=smtp,Addr=127.0.0.1,Name=MTA改为:#SMTPdaemonoptionsODaemonPortOptions=Port=smtp,Addr=10.254.1.253,Name=MTA[root@soft8named]#vi/etc/xinetd.d/ipop3servicepop3{socket_type=streamwait=nouser=rootserver=/usr/sbin/ipop3dlog_on_success+=HOSTDURATIONlog_on_failure+=HOSTdisable=no将这里的yes改为no}[root@soft8named]#vi/etc/xinetd.d/imapserviceimap{socket_type=streamwait=nouser=rootserver=/usr/sbin/imapdlog_on_success+=HOSTDURATIONlog_on_failure+=HOSTdisable=no将这里的yes改为no}[root@soft8named]#servicexinetdrestart[root@localhostmail]#sendmail-btADDRESSTESTMODE(ruleset3NOTautomaticallyinvoked)Enterrulesetaddress$=wlocalhost.localdomainlocalhost[127.0.0.1][root@soft8named]#vi/etc/mail/local-host-names#local-host-names-includeallaliasesforyourmachinehere.mail.yzl.comyzl.com[root@localhostmail]#sendmail-btADDRESSTESTMODE(ruleset3NOTautomaticallyinvoked)Enterrulesetaddress$=wlocalhost.localdomainlocalhost[127.0.0.1]mail.yzl.comyzl.com[root@soft8named]#vi/etc/mail/access#Checkthe/usr/share/doc/sendmail/README.cffileforadescription#oftheformatofthisfile.(searchforaccess_dbinthatfile)#The/usr/share/doc/sendmail/README.cfispartofthesendmail-doc#package.##bydefaultweallowrelayingfromlocalhost...localhost.localdomainRELAYlocalhostRELAY127.0.0.1RELAYyzl.comRELAY10.254.1.253RELAY[root@soft8named]#cd/etc/mail[root@soft8mail]#makemaphashaccess.dbaccess添加用户yzl,kk,在这里设的用户密码与用户名相同[root@localhostmail]#useraddyzl[root@localhostmail]#passwdyzlChangingpasswordforuseryzl.Newpassword:BADPASSWORD:it'sWAYtooshortRetypenewpassword:passwd:allauthenticationtokensupdatedsuccessfully.[root@localhostmail]#useraddkk[root@localhostmail]#passwdkkChangingpasswordforuserkk.Newpassword:BADPASSWORD:it'sWAYtooshortRetypenewpassword:passwd:allauthenticationtokensupdatedsuccessfully.[root@localhostmail]#2.重启sendmail发送邮件测试[root@localhostmail]#servicesendmailrestart关闭sendmail:[确定]关闭sm-client:[确定]启动sendmail:make:***Warning:File`virtusertable.db'hasmodificationtimeinthefuture(2008-12-3100:56:512008-12-3020:48:43.607615)make:warning:Clockskewdetected.Yourbuildmaybeincomplete.[确定]启动sm-client:[确定][root@localhostmail]#如下图设置outlookLinux邮件服务器安装与配置本人最新升级公司的linux邮件服务器,觉得最新的spamassassin功能非常好,所以整理一下安装步骤供网友参考。Linux邮件服务器配置MailScanner+ClamAV+Spamassassin一、sendmail安装与配置........................................................................1二、clamav的安装...................................................................................1三、SpamAssassin的安装与配置..........................................................3四、MailScanner的安装.........................................................................61.安装perl组件............................................................................62..........................................................................安装mailscanner83.安装clamav及spamassassin支持模块..................................84.mailscanner.conf注解..............................................................8五、MailScanner-mrtg...........................................................................8六、附录.................................................................................................101.我的mailscanner.conf配置....................................................102..........................................................mailscanner.conf配置说明17注:本文以redhat8.0为例一、sendmail安装与配置sendmail安装较简单,这里不再赘述。二、clamav的安装useradd-Mclamav#groupaddclamav#useradd-gclamav-s/bin/false-cClamAntiVirusclamavtar-zxvfclamav-0.88.2.tar.gz#cdclamav-0.88.2#./configure--sysconfdir=/etc#make#su-cmakeinstall#vi/etc/clamd.conf(在Example前面加#)#vi/etc/freshclam.conf(在Example前面加#)安裝後,修改以下檔案:/usr/local/etc/clamd.conf/usr/local/freshclam.conf將Example加上井字號註解掉→#Example執行/usr/local/freshclam測試是否能正常