在Linux系統(tǒng)下面架設Sendmail服務器 |
發(fā)布時間: 2012/8/11 10:34:47 |
架設sendmail服務器這次我們來學習Linux系統(tǒng)中的Sendmail服務器的配置。(郵件服務器的IP192.168.1.2主機域名為mail.ltest.com)前提:首先我們把DNS服務器安裝OK能夠解析,不明白的看http://www.cublog.cn/u/21675/showart_263507.html1,首先安裝Sendmail所需軟件[root@localhost~]#rpm-qsendmailm4sendmail-8.13.1-2m4-1.4.1-16已經默認安裝了,還需掛載第4張光盤,安裝與sendmail相關的軟件[root@localhostRPMS]#rpm-ivhsendmail-*warning:sendmail-cf-8.13.1-2.i386.rpm:V3DSAsignature:NOKEY,keyIDdb42a60ePreparing...###########################################[100%]1:sendmail-doc###########################################[33%]2:sendmail-cf###########################################[67%]3:sendmail-devel###########################################[100%]2.修改/etc/mail/local-hosts-name文件。增加本地域和主機的FQDN,記住只是本地主機的FQDN和域名FQDN,不要添加其他域的,否則向外域發(fā)送郵件的時候會出現userunknown的錯誤:[root@localhostnamed]#cat/etc/mail/local-host-names#local-host-names-includeallaliasesforyourmachinehere.ltest.com3,更改/etc/mail/sendmail.mc文件,修改下列地方:DaemonPortsOptions=Port=smtp,Addr=127.0.0.1,Name=MTA更改為:DaemonPortsOptions=Port=smtp,Addr=yourip或者0.0.0.0,Name=MTA然后m4/etc/mail/sendmail.mc>/etc/mail/sendmail.cf4,用戶管理認證的配置:修改/etc/mail/sendmail.mc中的字段,取消“TRUST_AUTH_MECH”一行和下一行“define”處的注釋。(于sendmail.mc文件的第48、49)然后m4/etc/mail/sendmail.mc>/etc/mail/sendmail.cf。[root@localhostnamed]#chkconfig--listsaslauthd開啟認證saslauthd0:off1:off2:off3:off4:off5:off6:off[root@localhostnamed]#chkconfig--level35saslauthdon建立用戶帳號[root@localhostnamed]#groupaddmailuser[root@localhostnamed]#adduser-gmailuser-s/sbin/nologinmike[root@localhostnamed]#adduser-gmailuser-s/sbin/nologinjohn[root@localhostnamed]#passwdmike[root@localhostnamed]#passwdjohn密碼都是123設置郵件別名和郵件群發(fā)修改/etc/aliases文件實現郵件轉發(fā)和郵件列表:admin:mike為郵件用戶mike設置別名admintestgroup:mike,john實現群發(fā)發(fā)給testgroup的郵件發(fā)給mike和john以上2個可以分別測試#newaliases5,訪問控制設置更改/etc/mail/accesss文件,增加:[root@localhostnamed]#cat/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.1RELAYltest.comRELAY完成后makemaphash/etc/mail/access.db</etc/mail/access進行數據庫更新。 6,#servicesendmailrestart[root@localhostnamed]#servicesendmailrestart啟動服務Shuttingdownsendmail:[FAILED]Startingsendmail:[OK]Startingsm-client:[OK][root@localhostnamed]#telnetlocalhost25Trying127.0.0.1...Connectedtolocalhost.localdomain(127.0.0.1).Escapecharacteris'^]'.220localhost.localdomainESMTPSendmail8.13.1/8.13.1;Sat,17Mar200712:54:47+0800ehlolocalhost250-localhost.localdomainHellolocalhost.localdomain[127.0.0.1],pleasedtomeetyou250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE250-DSN250-ETRN250-AUTHDIGEST-MD5CRAM-MD5LOGINPLAIN---認證應該生效250-DELIVERBY250HELPquit2212.0.0localhost.localdomainclosingconnectionConnectionclosedbyforeignhost.7,安裝郵局服務[root@localhostRPMS]#rpm-ivhdovecot-0.99.11-2.EL4.1.i386.rpm--aidwarning:dovecot-0.99.11-2.EL4.1.i386.rpm:V3DSAsignature:NOKEY,keyIDdb42a60ePreparing...###########################################[100%]1:perl-DBI###########################################[20%]2:postgresql-libs###########################################[40%]3:mysql###########################################[60%]4:dovecot###########################################[80%]5:perl-DBD-MySQL###########################################[100%]把1-5這些軟件都安裝完畢才可以繼續(xù)下去呢,,,,[root@localhost/]#vi/etc/dovecot.conf在protocols=imapimaps后添加pop3pop3s啟動dovecot服務[root@localhost/]#servicedovecotrestartStoppingDovecotImap:[FAILED]StartingDovecotImap:[OK][root@localhost/]#chkconfig--level35dovecotonOK了我們使用客戶機測試。(T002) 本文出自:億恩科技【1tcdy.com】 |