測試sendmail時出現
telnet localhost 25 telnet: connect to address ::1: Connection refused
&n telnet: connect to address 127.0.0.1: Connection refused
解決方式
vim /etc/mail/sendmail.cf
#註解此行 #O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA #新增 O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA
存檔後 , 在啟動 sendmail 後 25 port 就自動打開
修改允許relay清單
vim /etc/mail/access
存檔後下以下指令
makemap hash /etc/mail/access < /etc/mail/access
再重新測試telnet 25指令
telnet mail.your.com 25 220 localhost.localdomain ESMTP Sendmail 8.14.4/8.14.4; Fri, 21 Aug 2015 16:19:3 0 +0800 HELO cherry - 通知 SMTP Server 你是誰(在linux mail server上有帳號) 250 localhost.localdomain Hello x-x-x-x.HINET-IP.hinet.net [1 x-x-x-x], pleased to meet you mail from : [email protected] - 寄件者電郵地址 250 2.1.0 [email protected]... Sender ok rcpt to: [email protected] - 收件者電郵地址 250 2.1.5 [email protected]... Recipient ok - 以上步驟通過後,可以用 DATA 開頭並輸入信件內容,結束時用 “.” data //開始輸入信件內容 1234567890 test // 內容 354 Enter mail, end with "." on a line by itself . //結束 250 2.0.0 t7L8JUZE027739 Message accepted for delivery