CentOS中怎么安裝sendmail郵件服務(wù)-創(chuàng)新互聯(lián)

今天就跟大家聊聊有關(guān)CentOS中怎么安裝sendmail郵件服務(wù),可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長期合作伙伴,公司提供的服務(wù)項(xiàng)目有:國際域名空間、網(wǎng)絡(luò)空間、營銷軟件、網(wǎng)站建設(shè)、西夏網(wǎng)站維護(hù)、網(wǎng)站推廣。



1、 Sendmail安裝

在CentOS下,sendmail一般默認(rèn)是隨操作系統(tǒng)一起安裝的。如果安裝系統(tǒng)時(shí)沒有安裝sendmail服務(wù),手動安裝sendmail也很簡單:




代碼如下:


# yum install -y sendmail
# yum install -y sendmail-cf


2、 Senmail的SMTP認(rèn)證配置(不需要認(rèn)證的可忽略此步)

首先確認(rèn)saslauthd服務(wù)是否安裝或啟動。

安裝saslauthd服務(wù):


代碼如下:

# yum install -y saslauthd



啟動saslauthd服務(wù):


代碼如下:

# service saslauthd start



(1) 配置Senmail的SMTP認(rèn)證



代碼如下:


# vi /etc/mail/sendmail.mc


代碼如下:


dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl


將上面兩行的dnl去掉。在sendmail文件中,dnl表示該行為注釋行,是無效的,因此通過去除行首的dnl字符串可以開啟相應(yīng)的設(shè)置行。

(2) 設(shè)置Sendmail服務(wù)的網(wǎng)絡(luò)訪問權(quán)限



代碼如下:


# vi /etc/mail/sendmail.mc

代碼如下:


DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl


將127.0.0.1改為0.0.0.0,意思是任何主機(jī)都可以訪問Sendmail服務(wù)。如果僅讓某一個(gè)網(wǎng)段能夠訪問到Sendmail服務(wù),將127.0.0.1改為形如192.168.1.0/24的一個(gè)特定網(wǎng)段地址。

3、 生成Sendmail配置文件

Sendmail的配置文件由m4來生成,m4工具在sendmail-cf包中。如果系統(tǒng)無法識別m4命令,說明sendmail-cf軟件包沒有安裝。

生成Sendmail的配置文件:




代碼如下:


m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf


需要重啟Sendmail才能使配置文件生效。

4、postfix與sendmail的沖突問題
在Linux服務(wù)器(CentOS release 6.6)上配置好了sendmail后,測試發(fā)送郵件時(shí)發(fā)現(xiàn)有問題,檢查sendmail服務(wù)的狀態(tài),發(fā)現(xiàn)其處于“sendmail dead but subsys locked”, 檢查發(fā)現(xiàn)postfix服務(wù)也在運(yùn)行。只需要將postfix服務(wù)停掉即可。為什么會出現(xiàn)這種情況呢?Something was occasionally causing the postfix service to start which then caused the status of sendmail to jump to dead but subsys locked. 兩種似乎不兼容。
 
操作步驟:
 
(1):檢查sendmail服務(wù)的狀態(tài)



代碼如下:


[root@DB-Server ~]# service sendmail statussendmail dead but subsys lockedsm-client (pid  22112) is running...



(2):檢查postfix服務(wù)的狀態(tài)




代碼如下:


[root@DB-Server ~]# service postfix statusmaster (pid  1777) is running...



 
(3):停止postfix服務(wù)



代碼如下:


[root@DB-Server ~]# service postfix stopShutting down postfix: [  OK  ]



 
 
(4):重新啟動sendmail服務(wù)



代碼如下:


[root@DB-Server ~]# service sendmail stopShutting down sm-client: [  OK  ]Shutting down sendmail: [FAILED][root@DB-Server ~]# service sendmail stop[root@DB-Server ~]# service sendmail startStarting sendmail: [  OK  ]Starting sm-client: [  OK  ]




(5):禁用postfix在reboot后自動啟動

      檢查一下是否有設(shè)定 postfix 在 reboot 后自動啟動



代碼如下:


chkconfig --list | grep postfix

chkconfig postfix off


看完上述內(nèi)容,你們對CentOS中怎么安裝sendmail郵件服務(wù)有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。

網(wǎng)頁名稱:CentOS中怎么安裝sendmail郵件服務(wù)-創(chuàng)新互聯(lián)
URL標(biāo)題:http://www.muchs.cn/article38/ddspsp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、手機(jī)網(wǎng)站建設(shè)、微信小程序、網(wǎng)頁設(shè)計(jì)公司Google、網(wǎng)站設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)