Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509844 - mail-mta/postfix-2.10.3: default hostname is wrong
Summary: mail-mta/postfix-2.10.3: default hostname is wrong
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Eray Aslan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-08 12:59 UTC by Sven
Modified: 2020-10-12 09:54 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2014-05-08 12:59:36 UTC
The whole problem is described here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=214741

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:

http://postfix.1071664.n5.nabble.com/Automatically-substitute-FQDN-of-local-system-in-config-td90055.html#none

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.