Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 509844

Summary: mail-mta/postfix-2.10.3: default hostname is wrong
Product: Gentoo Linux Reporter: Sven <sven.koehler>
Component: Current packagesAssignee: Eray Aslan <eras>
Status: UNCONFIRMED ---    
Severity: normal CC: gentoo_bugs_peep, net-mail+disabled, williamh
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Sven 2014-05-08 12:59:36 UTC
The whole problem is described here:

PostFix uses the value returned by gethostname() as the default hostname. Since that value is not a fully qualified hostname, postfix then adds ".localdomain" to the end.

So even on systems where $(hostname -f) returns the right thing, postfix will use $(hostname -s).localdomain as the default hostname. Postfix seems to be simply broken in that regard.

The Gentoo ebuilds don't seem to apply the patch that is available for this problem (see the URL above). IMHO they should.

The obvious workaround is to set the hostname explicitly in postfix's config. But that shouldn't be necessary.

Reproducible: Always
Comment 1 Philippe Chaintreuil 2019-03-27 13:28:10 UTC
For informational purposes, here's upstream's response to such changes:

TL;DR: "hostname -f" isn't stable without a network or with a changing network (eg: laptop) therefore they believe it will break mail delivery on such systems.  This is why they append the .localdomain on gethostname() values returned without a dot.