当在脚本中执行发邮件操作得时候出现以下错误:send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
发送邮件:
[root@iZ23]# echo '大傻逼' | mail -s "测试邮件" 123456@qq.com
出现异常:
[root@iZ23]# 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
重新启动
service postfix start