Debian – Changed hostname on system; Postfix won’t start

debiannetworkingpostfix

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

Best Answer

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 the lo interface in /etc/network/interfaces. If that script (iptables-restore) fails, ifup aborts processing the interface. Try commenting it out and running ifup lo.

Related Topic