1 頁 (共 1 頁)

sendmail On Ubuntu 20.04

發表於 : 2020年 12月 15日, 12:00
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