Comment 2 for bug 180551

Revision history for this message
Ralph Corderoy (ralph-inputplus) wrote :

Hi Lamont, I think I've mislead you with the uname() comment. Yes, I agree postfix calls glibc's gethostname() and it's that which calls uname(), but the fault appears to lie with postfix's check_myhostname(). It's got two definitions but they appear the same apart from comments. It includes

    /*
     * If the local machine name is not in FQDN form, try to append the
     * contents of $mydomain. Use a default domain as a final workaround.
     */
    name = get_hostname();
    if ((dot = strchr(name, '.')) == 0) {
        if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0)
            domain = DEF_MYDOMAIN;
        name = concatenate(name, ".", domain, (char *) 0);
    }

and my ltrace output above does include the strchr(), mail_conf_lookup_eval(), and concatenate(). So I think it's this that's appending "localdomain".

The documentation, fully quoted above, says "The default is to use the fully-qualified domain name from gethostname()." However, gethostname() is returning just "blake" but postfix doesn't use that and instead goes and tacks on ".localdomain". Either the code or the documentation seems wrong.