發送郵件:
[root@itfswelog123]# echo '測試郵件標題' | mail -s "數據庫掛啦、掛啦、起床啦 " xx@163.com
出現異常:
[root@itfswelog123]# 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
將:
inet_interfaces = localhost
inet_protocols = all
改成:
inet_interfaces = all
inet_protocols = all
inet_interfaces 參數指定postfix系統監聽的網絡接口。缺省地,postfix監聽所有的網絡接口。如果你的postfix運行在一個虛擬的ip地址上,則必須指定其監聽的地址。如:
inet_interfaces = all
inet_interface = 192.168.1.1
重新啟動
service postfix start
然后測試就可以了