From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Olum Newsgroups: gmane.emacs.devel Subject: Re: init_system_name fqdn? Date: Sat, 17 Jun 2017 13:10:37 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497719489 19276 195.159.176.226 (17 Jun 2017 17:11:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2017 17:11:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 17 19:11:25 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMHFt-0004di-02 for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2017 19:11:25 +0200 Original-Received: from localhost ([::1]:35777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMHFw-0001SJ-NU for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2017 13:11:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMHFJ-0001SD-AI for emacs-devel@gnu.org; Sat, 17 Jun 2017 13:10:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMHFF-0002jQ-7w for emacs-devel@gnu.org; Sat, 17 Jun 2017 13:10:49 -0400 Original-Received: from cosmos.phy.tufts.edu ([130.64.84.253]:57489) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dMHFE-0002gB-Os for emacs-devel@gnu.org; Sat, 17 Jun 2017 13:10:45 -0400 Original-Received: from kdo by cosmos.phy.tufts.edu ([local]:local) with local id 1dMHF7-00006p-IE - Using Exim-4.84 (MandrivaLinux) MTA (return-path ); Sat, 17 Jun 2017 13:10:37 -0400 In-Reply-To: (message from Stefan Monnier on Sat, 17 Jun 2017 11:29:22 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 130.64.84.253 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215703 Archived-At: From: Stefan Monnier Date: Sat, 17 Jun 2017 11:29:22 -0400 > A while back, init_system_name tried to find the system's fully > qualified domain name. Then this code was taken out, and now it just > uses whatever gethostname returns. I think this is a poor choice. It depends on what it's used for. What is your use for it where it's a poor choice? The hostname of the machine I'm using is "cosmos", because that's what I put in /etc/hostname. Its FQDN is cosmos.phy.tufts.edu, and that's where my email address is. This is what "hostname -f" prints and what the old code used to guess. I connected to a server maintained by the Tufts IT department and it was set up the same way. Indeed, gethostname doesn't return a good choice for mail-host-address. But of all the machines I have had access to in the last 10 years, not a single one had an FQDN that was a good choice for mail-host-address either. So the only "advantage" of the old code was that it was more complex and could delay startup by 2min in some cases. I don't know what was causing this delay, but certainly we don't want it. Can "hostname -f" cause a similar delay? Would you suggest not guessing at all and requiring the installer to set mail-host-address or the user to set user-mail-address before mail can be sent? I think if we're going to guess at all, "hostname -f" or some equivalent code might be a better guess than gethostname(). From: Stefan Monnier Date: Sat, 17 Jun 2017 12:30:52 -0400 How do you suggest Emacs decide whether the "system is properly set up as an Internet host"? It cannot. The question is whether to guess at all, and if so what to guess. Why don't you just set up /etc/hostname (I don't think /etc/hosts is consulted to compute `system-name`) with the FQDN instead of a short name on those hosts that are properly setup as an Internet host? Of course I could do that. I was thinking that maybe there were other people who have similarly configured systems and would find it easier for emacs to work "of the box" instead of having to change their hostnames. But as you say maybe it's unlikely that guessing would work at all. If that's so, rather than possibly making wrong guesses which would lead replies to be discarded, maybe emacs by default should ask for your email address instead of making any guess. (Then it could set user-mail-address in your init file in the usual way, so it wouldn't have to ask again, except in the case of -Q.) Ken