今天在一台linux主机下在使用mail命令发送邮件时,报如下错误:
send-mail: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol
postdrop: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol
根据报错信息,应该是与postfix服务器的配置文件中的inet_protocols有关系,于是找到其主配置文件 /etc/postfix/main.cf
发现inet_protocols的值被配置成了all (想起应该是系统升级后,将postfix也升级了,也覆盖了之前的配置),
# Enable IPv4, and IPv6 if supported inet_protocols = all
解决方法(根据自己的服务器所在环境而修改,如下relayhost为新增行):
[qq_5201351@localhost ~]$ grep -E "^inet_protocols|^relayhost" /etc/postfix/main.cf inet_protocols = ipv4 relayhost = 10.10.1.130:25
最后让postfix重加载一下配置,发送邮件,测试,问题解决~、
最后,附其他有效配置,记录一下,内容如下:
[qq_5201351@localhost ~]$ cat /etc/postfix/main.cf |grep ^# -v |grep ^$ -v queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix inet_interfaces = localhost inet_protocols = ipv4 mydestination = $myhostname, localhost.$mydomain, localhost unknown_local_recipient_reject_code = 550 relayhost = 10.10.1.130:25 alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.10.1/samples readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/15500154.html