emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: init_system_name fqdn?


From: Tim Cross
Subject: Re: init_system_name fqdn?
Date: Sun, 18 Jun 2017 11:48:26 +1000

If you have a fqdn for a host and hostname -f does not return the fqdn, then your system is not configured correctly. This would likely cause errors or problems with other software as well. 

Having a FQDN and a DNS entry are not the same thing. You can have a fqdn without a DNS entry, though it isn't very useful of course as nobody else can resolve the fqdn to an IP address (unless you put a manual entry in /etc/hosts of course). 

There are only incidental relationships between FQDN and the ability to send/receive email. You definitely do not need a fqdn to send email and there are a number of ways to have email delivered to a machine without a fqdn or DNS entry e.g. fetchmail. mailhobs with local /etc/hosts entries with 192.168.x.x or 10.x.x.x addresses etc. 

There are many different ways for a system to support sending/receiving email and it is extremely unlikely that Emacs will be able to determine this correctly automatically. Any attempt to do so will almost certainly be complex and error prone and a pain to maintain. Add to this that far fewer hosts actually do email anymore. 20 years ago, I always setup a local mail server on my system. Now I rarely do. ISPs now frequently block port 25 and most medium to large organisations have very strict policies in place to prevent users from setting up mail servers due to the frequency of misconfiguration that either caused errors or created an open mail relay which could be used for spam and potentially adversely impact on an organisations reputation or result i their mail being blackholed etc. 

I think I'm with Stefan on this one. The only sane and maintainable solution is to have emacs check for an explicit mail address configuration set by the user and if none exists, prompt the user for one when sending email. In reality, you will probably have to prompt for the name of the mail server as well and possibly a password as many mail servers now use authenticated smtp and you cannot assume the local host has a configured MTA.

Or you just display a message saying to cut and paste your message into your preferred mail client and send it that way.

Tim

On 18 June 2017 at 00:17, Ken Olum <address@hidden> wrote:
If your system has no fully qualified domain name, i.e., there is no DNS
entry that points to this host, then of course you cannot receive and
probably cannot send email, and I don't think it's very important
exactly how it fails.  But if your system is properly set up as an
Internet host but gethostname does not return the FQDN (e.g., because
you put the short name first in /etc/hosts), then I think
init_system_name should use the FQDN.  In the cases in which I have
observed this, "hostname -f" does return the FQDN.

In emacs-24, the procedure of init_system_name was to first do
gethostname, but if that didn't return a qualified name, it would try
getaddrinfo with ai_canonname, and if that failed look in the list of
aliases given by gethostbyname.  Later all this code was removed and now
it just calls gethostname.

                                        Ken




--
regards,

Tim

--
Tim Cross


reply via email to

[Prev in Thread] Current Thread [Next in Thread]