From: Curtis J Blank
Date: Wed, 26 Jun 2024 14:14:37 -0500
I think I found the problem. The reported error: "amavis[]: Insecure
directory in $ENV{PATH} while running with -T switch at
/usr/lib/perl5/5.38.2/Net/Domain.pm line 173." is totally bogus and has
nothing to do with the problem.
Indeed, the fact that Net::Domain uses domainname at all is bogus, since
domainname returns the NIS domain, which has nothing to do with Internet
domains. Net::Domain seems to work fine on my system without that code,
and without hostname set to a FQDN (and without the /etc/resolv.conf
hack I mentioned yesterday), so I may propose this as a fix to the
maintainer. (Not that any such fix would be released soon enough to do
you any good.)
It appears the hostname has to be a FQDN. Having hostname set to the
host name and domainame set to the domain name is not adequate.
Not necessarily . . .
When hostname is a FQDN amavisd starts without error. The same config
with the hostname *not* being FQDN on my current postfix email server
using amavisd also is and has been running that way since at least 2014
if not 2011.
The key is how Net::Domain constructs the FQDN, since Net::Domain has
several ways of finding the domain name and tacking it onto a bare
hostname. Besides that /etc/resolv.conf hack, it looks at what
gethostbyname returns for local host names to see if any of those have
domains, and uses the LOCALDOMAIN and DOMAIN environment variables as a
last resort.
In short, you have other options beyond changing hostname.
-- Bob