Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postfix: Fix invalid hostname #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Craeckie
Copy link

I get the following when trying to build postfix:

...
setting myhostname: 2c80634c9b30..
setting alias maps
setting alias database
mailname is not a fully qualified domain name.  Not changing /etc/mailname.
setting destinations: $myhostname, 2c80634c9b30, localhost.localdomain, , localhost
setting relayhost:
setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: all
setting inet_protocols: all
/etc/aliases does not exist, creating it.
WARNING: /etc/aliases exists, but does not have a root alias.

Postfix (main.cf) is now set up with a default configuration.  If you need to 
make changes, edit /etc/postfix/main.cf (and others) as needed.  To view 
Postfix configuration values, see postconf(1).

After modifying main.cf, be sure to run 'service postfix reload'.

Running newaliases
newaliases: warning: valid_hostname: misplaced delimiter: 2c80634c9b30..
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: 2c80634c9b30..
dpkg: error processing package postfix (--configure):
 installed postfix package post-installation script subprocess returned error exit status 75

My pull request solves this by changing the hostname to example.com.
The extra code only runs if apt install fails, so it won't affect those for whom it worked before.
The set -x shows which command is currently executed, this makes troubleshooting much easier.

@gsiv
Copy link
Member

gsiv commented Oct 13, 2021

Thank you for the report and your patch.

setting myhostname: 2c80634c9b30..

The problem seems to be a misconfiguration of your system because 2c80634c9b30.. really is not a valid hostname. I could not find a Docker system that did not set fully qualified hostnames here. I recommend that you try to find out why your containers end up with hostnames like that.

I also don't particularly like the proposed workaround of following up a failed installation with --fix-broken. Maybe the problem can intead be worked around more specifically by setting a valid hostname prior to apt-get install or by preseeding debconf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants