Postfix myhostname defaults to uname() not gethostname().
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
postfix (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
Binary package hint: postfix
Given 7.10's postfix-
myhostname (default: see postconf -d output)
The internet hostname of this mail system.
The default is to use the fully-qualified domain name from gethostname().
$myhostname is used as a default value for many other configuration parameters.
why is it using uname(2) and tacking on "localdomain".
$ hostname
blake
$ hostname -f
blake.inputplus
$ uname -n
blake
$ sudo ltrace -So /tmp/3 postconf -d myhostname
myhostname = blake.localdomain
$ sed -n '/^get_
get_hostname(
SYS_uname(
<... get_hostname resumed> ) = 0x8061098
strchr("blake", '.') = NULL
mail_conf_
concatenate(
vstream_
vstream_
SYS_write(1, "myhostname = blake.localdoma
<... vstream_fflush resumed> ) = 0
exit(0 <unfinished ...>
SYS_exit_group(0 <unfinished ...>
+++ exited (status 0) +++
$
Note, it's get_hostname() calls uname(2). Following postconf(5), I should be able to live with the default myhostname but can't. Either the documentation or the code would seem incorrect.
Changed in postfix (Ubuntu): | |
importance: | Undecided → Low |
[somewhat edited for brevity...] namebuf, sizeof(namebuf)) < 0)
msg_ fatal(" gethostname: %m");
const char *get_hostname(void)
{
/*
* The gethostname() call is not (or not yet) in ANSI or POSIX, but it is
* part of the socket interface library. We avoid the more politically-
* correct uname() routine because that has no portable way of dealing
* with long (FQDN) hostnames.
*/
if (my_host_name == 0) {
if (gethostname(
postfix doesn't call uname. Sounds like glibc is doing something "helpful".
lamont