Ah ha! Thanks! Your explanation made me think of something that might be the difference between my two servers and why the new one needs the hostname set to a FQDN. /etc/resolv.conf The new server only had one entry, one nameserver. The existing server has two nameservers listed and a "search <myDomain>" entry. Oversight on my part. Put the second entry and search statement in resolv.conf on the new server. Then on the new server set the hostname to just the servers name and cleared domainname so it then matched the old server's configuration and amavisd successfully starts. I'm betting having the search in resolv.conf is the key. -Curt On 6/26/24 14:58, Bob Rogers wrote:
From: Curtis J Blank <curt@curtronics.com> 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