請問大家 我最近剛剛新裝pure的ubuntu 18.04在aws lightsail上
AWS預設有鎖port 25,我看的網路教學說465,587 port沒鎖
所以我都用port 587做實驗
以下是我的步驟:
1. 安裝sendmail
sudo apt-get install sendmail
2. 變更/etc/mail/sendmail.mc,改用submission (587 port)
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea,
Addr=0.0.0.0')dnl
3.重新產生sendmail.cf 並重啟sendmail
sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
sudo service sendmail restart
4. 測試傳送一個mail
echo "Subject: sendmail test" | sendmail -v [email protected]
5. 獲得錯誤訊息
[email protected] Connecting to [127.0.0.1] via relay...
[email protected] Deferred: Connection refused by [127.0.0.1]
6. 查看/var/log/mail.log 錯誤訊息
Mar 24 07:20:03 ip sm-msp-queue[6638]: :
[email protected], ctladdr=nash777 (1001/1001), delay=1+00:46:16,
xdelay=00:00:00, mailer=relay, pri=8760023, relay=[127.0.0.1] [127.0.0.1],
dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
看起來我是被我自己拒絕了,也不知道怎麼解決,我查看了網路教學
看了/etc/hosts 裡面 我只有單純的 127.0.0.1 localhost
netstat -plnt 查看sendmail的port 也確認是587 port
請問有解法嗎?不知道我自己有錯誤在哪邊?或其他可以試的辦法?
我已經向AWS申請解除限制了,但我看網路上人家說可以用587 port