517_3_smtp_sendmail_103.5.17

Download Report

Transcript 517_3_smtp_sendmail_103.5.17

smtp: sendmail
記得先關postfix
安裝 win7 telnet.exe (test用)
• 控制台 > 程式集 > 開啟或關閉Windows功能
> 勾 Telnet用戶端
安裝sendmail
•
•
•
•
rpm -qa | grep sendmail
yum -y install sendmail sendmail-cf
service sendmail status (start)
chkconfig --list sendmail
– (預設開機啟動)
設定 sendmail.cf,
讓sendmail 可以給外部連線
• 修改前 win7 telnet
– telnet dns.kpp88.com 25 不能連
– 正連線到 dns.kpp88.com...無法開啟到主機的連線, 在連
接埠 25: 連線失敗
• vim /etc/mail/sendmail.cf
– Search Addr=127.0.0.1 > 預設 127.0.0.1 無法給外部連線,
改為 Addr=0.0.0.0
– 重跑 sendmail, if fail, restart again
– win7 test: telnet dns.kpp88.com 25
220 dns.kpp88.com ESMTP Sendmail 8.14.4/8.14.4; Mon, 28
Oct 2013 11:06:28 +0800
設定 sendmail 正確 permission,
才可以正確的對外部發信,否則會 relaying denied
• # vim /etc/mail/access
增加:
Connect:10.10.88.* RELAY
Connect:120.125.144.*
RELAY
Connect:120.125.145.*
RELAY
自己視情況加,若要全部開放,請加:
Connect:*.*
RELAY
• 注意,網段最後一碼是*,不是0
• 最後要透過上述新設定內容,製作新的 access.db 檔,
給sendmail 讀取:
– makemap hash /etc/mail/access.db < /etc/mail/access
設定[email protected]&
[email protected] 都可以收發email
• 目前,只有[email protected]可以收發 email,若
要讓[email protected]也可以收發 email,請修改:
• vim /etc/mail/local-host-names
加下面兩行:
kpp88.com
dns.kpp88.com
• service sendmail restart
Win7 outlook 設定
[email protected] & [email protected][email protected]
– 寄一封email給自己 & [email protected]
– aa & bb都要收到信, 如下
[email protected] 寄給
[email protected]
• 等一會後,會收到系統回信
– 伺服器錯誤: '550 5.7.1 <[email protected]>...
Relaying denied.
–未合法申請 domain,無法寄到外面的
email!
• reboot
– 開始安裝&設定 openwebmail