标题说明了一切。我将系统上的主机名更改为 FQDN,现在 Postfix 无法启动,说:
Sep 1 21:57:06 mailer postfix/master[4759]: fatal: bind 127.0.0.1 port 10029: Cannot assign requested address
有趣的是,它在错误日志中仍然有旧名称“mailer”。我已经更新了我的配置,使它应该有新的主机名:
myhostname = mailer.xxx.com
mydomain = mailer.xxx.com
但没有喜悦。
请帮忙!如果您需要任何其他信息,请告诉我...
后置信-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地址:
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/主机:
127.0.0.1 localhost localhost.localdomain
173.45.237.59 mailer.xxx.com
/etc/网络/接口
# 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 更改为一般网络问题。
我怀疑这
pre-up
是. 如果该脚本 ( ) 失败,则中止处理接口。尝试将其注释掉并运行。lo
/etc/network/interfaces
iptables-restore
ifup
ifup lo
为什么那里没有 127.0.0.1?在我运行的服务器上(有效),我得到:
作为测试,试试这个:
如果你不明白,那不是 postfix 的问题 :)
请粘贴 的输出
postconf -n
和ip addr
的内容/etc/hosts
。通常,您描述的错误表明它正在尝试绑定到非本地 IP 地址。上述命令的输出应该可以帮助我们找出原因。
您没有环回地址。它与您的 Postfix 配置无关,某些东西(或某人)对您的
/etc/network/interfaces
文件进行了篡改。确保它包含:在顶部,然后运行
ifup lo
,一切都会好起来的。我刚刚遇到了完全相同的问题。Postfix 和我的 dkim 过滤器无法启动,结果发现它与关闭的环回接口相关联。我试过了,
ifup lo
但得到了ifup: interface lo already configured
。所以,我只是做了一个ifdown lo
然后一个ifup lo
. 我没有收到错误消息,所以我尝试启动 dkim/postfix,一切都开始了。不知道为什么重启后环回接口没有正常启动。仍然需要调查。