sendmail On Ubuntu 20.04

Ubuntu 20.04.1 LTS (Focal Fossa)
回覆文章
leeyc
文章: 81
註冊時間: 2020年 10月 23日, 01:54

sendmail On Ubuntu 20.04

文章 leeyc »

$ sudo apt install sendmail mailutils sendmail-bin

$ sudo nano /etc/hosts


Install
# apt install sendmail
# apt install m4
# apt install sendmail-cf

修改 nano /etc/mail/sendmail.mc 約116行,把127.0.0.1改為0.0.0.0
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl

編碼
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

4. 重啟sendmail
# systemctl restart sendmail
# systemctl status sendmail

5. 查看是否有啟動
# netstat -at | grep smtp
tcp 0 0 *:smtp *:* LISTEN
回覆文章