2023年8月30日 星期三

RockyLinux 9.2 sensmail allow relay

#安裝sendmail
yum install sendmail

#修改設定
cd /etc/mail
vi sendmail.cf
將這一行mark起來(allow remote connect)
#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

vi relay-domains
新增要寄信的IP,Ex: 192.168.10.29

#啟動sendmail
systemctl start sendmail
systemctl enable sendmail

#開啟防火牆
firewall-cmd --permanent --add-port=25/tcp
firewall-cmd --reload