postfix: fatal: parameter inet_interfaces: no local interface found for ::1

  •   
  • 54
  • linux
  • 0
  • dodobook
  • 2019/07/01

我在搭建GitLab的时候需要安装postfix邮件通知服务,按照官方的文档安装的时候。安装文档如下https://about.gitlab.com/install/#centos-7

#安装脚本执行到这一步的时候
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix


#当我在执行启动的时候报错如下
sudo systemctl start postfix
Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.

#查看详细的报错信息
[root@localhost ~]# systemctl status postfix.service 
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-07-01 09:03:08 CST; 23s ago
  Process: 29176 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)
  Process: 29173 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
  Process: 29169 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=75)

Jul 01 09:03:06 localhost systemd[1]: Starting Postfix Mail Transport Agent...
Jul 01 09:03:06 localhost aliasesdb[29169]: /usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for ::1
Jul 01 09:03:07 localhost aliasesdb[29169]: newaliases: fatal: parameter inet_interfaces: no local interface found for ::1
Jul 01 09:03:07 localhost postfix[29176]: fatal: parameter inet_interfaces: no local interface found for ::1
Jul 01 09:03:08 localhost systemd[1]: postfix.service: control process exited, code=exited status=1
Jul 01 09:03:08 localhost systemd[1]: Failed to start Postfix Mail Transport Agent.
Jul 01 09:03:08 localhost systemd[1]: Unit postfix.service entered failed state.
Jul 01 09:03:08 localhost systemd[1]: postfix.service failed.


#错误信息
postfix: fatal: parameter inet_interfaces: no local interface found for ::1 

postfix_fatal_error

网上搜索了一下解决方案如下:

#解决方法: 
vi /etc/postfix/main.cf

#发现配置为:
inet_interfaces = localhost
inet_protocols = all

#改成:
inet_interfaces = all 或者 inet_interfaces = 127.0.0.1
inet_protocols = all

#重新启动postfix服务即可
systemctl start postfix


#修改后的配置如下
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

# Enable IPv4, and IPv6 if supported
inet_protocols = all

珍惜时间比什么都重要,因为分分秒秒的时间是构成生命的要素......