Title says it all. I changed my hostname on my system to a FQDN and now Postfix won't start, saying:
Sep 1 21:57:06 mailer postfix/master[4759]: fatal: bind 127.0.0.1 port 10029: Cannot assign requested address
Interestingly enough, it still has the old name "mailer" in the error log. I've updated my configuration so that it should have the new hostname:
myhostname = mailer.xxx.com
mydomain = mailer.xxx.com
But no joy.
Please help! Let me know if there's any other info you need...
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/network/interfaces
# 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
Adding as a new answer, since the topic of the question has changed from Postfix to a general networking problem.
I suspect it's the
pre-up
clause on thelo
interface in/etc/network/interfaces
. If that script (iptables-restore
) fails,ifup
aborts processing the interface. Try commenting it out and runningifup lo
.Why isn't 127.0.0.1 on there? On a server I run (that works), I get:
As a test, try this:
If you don't get that, it's not postfix's problem :)
Please paste the output of
postconf -n
,ip addr
and the content of/etc/hosts
.Generally the error you're describing indicates that it's trying to bind to a non-local IP address. The output of the above commands should help us figure out why.
You have no loopback address. It's got nothing to do with your Postfix config, something (or someone) has monkeyed with your
/etc/network/interfaces
file. Make sure it contains:At the top, then run
ifup lo
and all will be well.I just ran into the exact same problem. Postfix and my dkim filter wouldn't start and it turned out to be linked to the loopback interface being down. I tried an
ifup lo
but gotifup: interface lo already configured
. So, I just did anifdown lo
and then anifup lo
. I didn't get an error message so I tried starting dkim/postfix and everything started right up.Not sure why the loopback interface didn't start properly after a reboot. Still need to look into that.