INN and docker default hostnames

Julien ÉLIE julien at trigofacile.com
Fri Sep 20 10:12:05 UTC 2024


Hi all,

Following a discussion we had here in April 2020.  We regularly have 
questions about Docker installations where hostnames are not fully 
qualified.  Let's see if we cannot improve that.

Currently, INN takes for the hostname in the following order:
- the result of gethostname(3) if fully qualified;
- the result of getaddrinfo(3) if fully qualified;
- the concatenation of "hostname.domain" where hostname is the result of 
gethostname(3) and domain the value of the eponym parameter in inn.conf.

I suggest to also recognize an INN_HOSTNAME environment variable, if 
set.  Wouldn't it solve the problems when using Docker or like?

We already read some environment variables like INNCONF (alternate path 
to inn.conf), NNTPSERVER, INND_BIND_ADDRESS, INND_BIND_ADDRESS6, 
FROMHOST, ORGANIZATION, and UU_MACHINE.

Why not have the following behaviour for the hostname:
- the INN_HOSTNAME environment variable if fully qualified;
- the result of gethostname(3) if fully qualified;
- the result of getaddrinfo(3) if fully qualified;
- the concatenation of "hostname.domain" where hostname is the result of 
gethostname(3) and domain the value of the eponym parameter in inn.conf.



> INN refuses to run with a single component hostname because the chances
> are low that it's globally unique, and historically INN considers it
> unsafe to run without an FQDN to put in the Path.  This is an old, old
> check, predating containers and Docker and all of that world.
> 
> I do think it's at least mildly dubious to run INN without an FQDN to put
> into the Path header.  I'm a little dubious about relaxing this
> check in general, since putting unqualified hostnames in the Path header
> and using them for loop checking sounds likely to cause weird problems.

I also agree not to relax the check because of potential unexpected 
issues in generated Path and Message-ID header fields.

-- 
Julien ÉLIE

« If your dog is barking at the back door and your wife yelling at the
   frontdoor, who do you let in first?  The dog of course…  at least
   he'll shut up after you let him in! »



More information about the inn-workers mailing list