Wietse Venema wrote: > Moe: >> The right way, as explained by Mike Paul in that ticket, would be to >> call gethostbyname() on the return value of gethostname() and then split >> the result of *that* into hostname and domainname. > > That would be AN INCREDIBLY STUPID IDEA, causing all mail processes > to hang when the network is down and the hostname is not in /etc/hosts.
Well, that's what 'hostname -f' does and, by my understanding, the only proper way to figure out the FQDN. Remember we're talking about the case of auto-detection here - if someone is not willing to take that risk then they should hardcode 'myhostname' and 'mydomainname' in main.cf, no? Moreover I'd suggest that postfix may very well accept a FQDN from gethostname() if that returns a value that contains dots. That way people who prefer it that way can have theirs, and people who take 'gethostname()' literally get theirs, too. Cheers, Moe