今天在弄一個郵件通知的時候,突然發現連最基本的郵件都發不出去,報錯了
[root@xhk ~]# echo '標題' | mail -s "內容" [email protected]
出現異常:
[root@xhk ~]# send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
查看centos中的postfix日誌
more /var/log/maillog
postfix: fatal: parameter inet_interfaces: no local interface found for ::1
vim /etc/postfix/main.cf
可以看到這裏的配置文件配置的是localhost,問題就出現在這裏
inet_interfaces = localhost
inet_protocols = all
我們把他改成
inet_interfaces = all
inet_protocols = all
重新啓動郵件服務
[root@xhk ~]# systemctl restart postfix
再次發送郵件,成功!!!