linux系統SendMail詳細配置

2021-04-22 18:44:54 字數 4050 閱讀 2099

1、 安裝相關服務

dnsmailserver(sendmail、imap)

2、 啟動相關服務

service named restart

service sendmail restart

service xinetd restart

chkconfig ipop3 on

3、 配置dns,新增mx紀錄

配置dns略

正/反向區間檔案新增mx紀錄

in mx 10(優先順序) mail.anniey.com

mail in a 192.168.1.100

4、 主配置檔案

/etc/mail/sendmail.cf

搜尋/smtp

port=smtp,addr=192.168.1.100

5、 接受域配置檔案

vi /etc/mail/local-host-names

新增anniey.com

192.168.1.100

6、中繼**配置檔案

/etc/mail/access.db(不可訪問)

vi /etc/mail/access

新增anniey.com

192.168.1

退出makemap hash access.db < access

6、 新增使用者

useradd user01

passwd user01

useradd user02

passwd user02

7、 重啟服務

service sendmail restart

service xinetd restart

補:郵件使用者別名,郵件域別名

a)使用者別名

1、vi /etc/aliases

別名 使用者名稱

a01 user01

a02 user02

退出2、newaliases

b)郵件域別名

1、配置相關dns略

2、新增域別名

vi /etc/mail/sendmail.cw

anniey.com

johnny.com

退出3、接受域配置檔案

vi /etc/mail/local-host-names

anniey.com

johnny.com

192.168.1.100

4、重啟服務

service named restart

service sendmail restart

service xinetd restart

補:啟用smtp認證

1、 安裝相關模組

rpm –qa | grep sasl

linux盤中:redhat—〉rpms—>sasl*

2、 修改 /etc/mail/sendmail.mc(sendmail.cf的源**)

vi /etc/mail/sendmail.mc

查詢:43 trust_auth*

:44:85 daemon_option*

:92 daemon*

注:去掉dnl(注釋)

3、 生成sendmail.cf

m4 sendmail.mc >sendmail.cf

4、刪除部分中繼,以免開後門

5、客戶機

我的伺服器要求身份驗證

經過以上步驟後,應該就可以用outlook express正常傳送郵件了,但這時還不能用outlook express從伺服器端收取郵件的,因為sendmail預設狀態並不具備pop3功能,我們還得自己安裝並啟用它。

1、安裝pop3服務

rpm -qa imap

imap-2001a-18

rpm -ivh imap-2001a-18.i386.rpm

2.啟用pop3服務。

pop3服務:請先修改/etc/xinetd.d/ipop3檔案,將其中的disable=yes改為disable=no後儲存;然後重新啟動xinetd程式來讀取這個修改過的配置檔案,使之生效。

/etc/rc.d/init.d/xinetd restart

* 利用telnet 命令傳送郵件 :

用telnet smtp傳送郵件(偽裝163發給gmail)

如果伺服器smtp需要驗證,helo完要輸入

auth login

會一次提示你

334 vxnlcm5hbwu6

和334 ugfzc3dvcmq6

後邊的內容是提示輸入使用者名稱和口令,資訊是經過base64編碼的

輸入的使用者名稱和口令也要經過編碼,這裡是乙個編碼、解碼的工具

smtp認證通過後會顯示

235 2.0.0 authentication successful

在用data命令之後可以直接書寫正文,但也按照下面的「mime-version:」、「from:」、「to:」、「cc:」、「subject:」、「content-type:」 等固定的格式分別進行書寫。會讓e-mail的顯示及郵件頭比較完整,如下:

mime-version: 1.0

from: xuanfei2046<[[email protected]][color=#0000ff][email protected][/color][/email]>

to: xuanfei<[[email protected]][color=#0000ff][email protected][/color][/email]>

cc: xuanfei2046 <[[email protected]][color=#0000ff][email protected][/color][/email]>

subject: helo

content-type: text/plain;charset="gb2312"

linux下sendmail郵件系統安裝詳情

sendmail是linux系統中乙個郵箱系統,如果我們在系統中配置好sendmail就可以直接使用它來傳送郵箱。sendmail的配置檔案 etc mail sendmail.cf sendmail的主配置檔案 etc mail access 中繼訪問控制 etc mail domaintable...

linux關閉sendmail服務

方法一 a.root sample etc rc.d init.d sendmail stop 關閉sendmail服務 或者 root sample service sendmail stop 關閉sendmail服務 shutting down sendmail ok shutting down...

關閉linux的sendmail服務

linux 系統啟動的時候總是在 sendmail 服務這停止較長的時間,遠遠超過了我可以忍耐的時間 chkconfig命令 root linux1 chkconfig list sendmail sendmail 0 off 1 off 2 on 3 on 4 on 5 on 6 off 可以看到...