OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Incorrect domainname

From: Wietse Venema (wietseporcupine.org)
Date: Mon Dec 03 2007 - 08:16:05 CST


Paul Hewlett:
> I recently upgraded from 2.3.6 to 2.4.5 on my Gentoo master box and postfix is
> now unable to get the domainname - it insists that it is 'localdomain'.
>
> My setup is very simple - I am just using postfix as the local mta and
> forwarding any non-local addresses to another gentoo box also running
> postfix. I have been using postfix in this way for a number of years without
> trouble but I note that postfix 2.4 has a documented 'improvement' whereby
> the hostname does not necessarily have to include the FQDN and will default
> to
> localdomain. Executing hostname,hostname -f and dnsdomainname commands from
> the shell prompt returns the correct result in all cases. i.e. sundown,
> sundown.cpt.gccs.co.za and cpt.gccs.co.za.

Postfix uses the gethostname() system library routine. What is the
result from that function?

If the result from gethostname() is a fully qualified name
("sundown.cpt.gccs.co.za") then Postfix will use that to derive
the mydomain value ("cpt.gccs.co.za");

If the result from gethostname() is an unqualified name ("sundown")
then Postfix sets mydomain to "localdomain" unless you specify
mydomain or myhostname in main.cf.

        Wietse