Centos 7安装Postfix用于发送提醒邮件
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
1. 卸載sendmail,沒(méi)有安裝sendmail的跳過(guò)
yum remove sendmail2. 安裝 Postfix
yum install postfix?
3. 更改默認(rèn)MTA為Postfix
/usr/sbin/alternatives --set mta /usr/sbin/sendmail.postfix4. 檢查是否將MTA改為Postfix
alternatives --display mta5. 配置Postfix,修改main.cf
vi /etc/postfix/main.cf查找以下各項(xiàng),去掉最前面的#,參考說(shuō)明修改
myhostname = www.ifshow.com mydomain = ifshow.com myorigin = $mydomain inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain relay_domains = home_mailbox = Maildir/myhostname是服務(wù)器的主機(jī)名,mydomain是域名,myorigin定義郵箱后綴,inet_interfaces是指定使用的網(wǎng)絡(luò)接口,relay_domains是轉(zhuǎn)發(fā)域留空,home_mailbox是指定郵箱格式。
6.?啟動(dòng)Postfix并設(shè)為開(kāi)機(jī)自啟
systemctl start postfix.service systemctl enable postfix.service到此完成配置,其它服務(wù)已經(jīng)能夠通過(guò)postfix發(fā)送提醒郵件。
由于只發(fā)郵件,所以防火墻不必開(kāi)啟POP3、SMTP等服務(wù)端口。
學(xué)習(xí)自:https://www.ifshow.com/centos-7-install-postfix-for-sending-e-mail-alerts/
郵件服務(wù)器很有必要。用來(lái)及時(shí)通知管理員服務(wù)器警報(bào)情況
后面再來(lái)補(bǔ)充一個(gè)代碼報(bào)錯(cuò)實(shí)例
轉(zhuǎn)載于:https://my.oschina.net/u/2280651/blog/2996240
總結(jié)
以上是生活随笔為你收集整理的Centos 7安装Postfix用于发送提醒邮件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Mybatis Plus 2 升到 My
- 下一篇: 求质数