更改了系统上的主机名称; Postfix将无法启动

标题说明了一切。 我将我的系统上的主机名更改为FQDN,现在Postfix不会启动,并说:

Sep 1 21:57:06 mailer postfix/master[4759]: fatal: bind 127.0.0.1 port 10029: Cannot assign requested address 

有趣的是,在错误日志中仍旧有“邮件程序”的名字。 我已更新我的configuration,以便它应该有新的主机名:

 myhostname = mailer.xxx.com mydomain = mailer.xxx.com 

但没有喜乐。

请帮忙! 让我知道如果有任何其他信息,你需要…


Postconf -n:

 alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all mailbox_size_limit = 0 mydestination = mailer.xxx.com mydomain = mailer.xxx.com myhostname = mailer.xxx.com mynetworks = xxx.xxx.xxx.0/24, 127.0.0.0/8 myorigin = /etc/mailname notify_classes = bounce, 2bounce, delay, policy protocol, resource, software readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_client_restrictions = permit_mynetworks, reject smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes 

ip addr:

 1: lo: <LOOPBACK> mtu 16436 qdisc noop state DOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether 40:40:4b:1c:8b:d1 brd ff:ff:ff:ff:ff:ff inet 173.45.237.59/24 brd 173.45.237.255 scope global eth0 inet6 fe80::4240:4bff:fe1c:8bd1/64 scope link valid_lft forever preferred_lft forever 

/ etc / hosts中:

 127.0.0.1 localhost localhost.localdomain 173.45.237.59 mailer.xxx.com 

的/ etc /networking/接口

 # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or # /usr/share/doc/ifupdown/examples for more information. # The loopback network interface auto lo iface lo inet loopback pre-up iptables-restore < iptables.up.rules # The primary network interface # Uncomment this and configure after the system has booted for the first time auto eth0 iface eth0 inet static address 173.45.237.59 netmask 255.255.255.0 gateway 173.45.237.1 dns-nameservers 173.45.224.4 173.45.224.5 

添加一个新的答案,因为问题的主题已经从Postfix变成了一个普通的networking问题。

我怀疑这是/etc/network/interfaces lo界面上的pre-up子句。 如果该脚本( iptables-restore )失败,则ifup中止处理该接口。 尝试评论和运行如果ifup lo

 1: lo: <LOOPBACK> mtu 16436 qdisc noop state DOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 

那里为什么不是127.0.0.1? 在我运行的服务器上(工作),我得到:

 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 

作为一个testing,试试这个:

 > nc -l -s 127.0.0.1 -v -p 12345 listening on [127.0.0.1] 12345 ... 

如果你不明白,这不是后缀的问题:)

请粘贴postconf -nip addr的输出和/etc/hosts的内容。

通常,您正在描述的错误表明它正尝试绑定到非本地IP地址。 上述命令的输出应该可以帮助我们找出原因。

你没有回送地址。 这与你的Postfixconfiguration没有任何关系,你的/etc/network/interfaces文件中有一些东西(或某人)已经被修改了。 确保它包含:

 auto lo iface lo inet loopback 

在顶部,然后运行,如果一切都会好的。

我刚碰到同样的问题。 Postfix和我的dkimfilter不会启动,结果链接到closures的接口。 我尝试了一个ifup lo但得到了ifup: interface lo already configured 。 所以,我只是做了一个ifdown lo ,然后是ifup lo 。 我没有得到一个错误信息,所以我尝试启动dkim / postfix,一切都开始了。

不知道为什么在重新启动后,回送界面没有正常启动。 还需要研究一下。