Amavis - can't start service

On a fresh installation I’m trying to set-up a mail server.
I’ve some services working (Fetchmail, Postfix, Dovet) but when I try to use Amavis it will not start.
Even without touching /etc/amavis.conf the service amavis ended with errors.
This is what I get from journal :

MAXLEAP160:/usr/lib/perl5/5.42.0/Net # journalctl -xeu amavis

apr 10 21:32:03 MAXLEAP160 amavis[4050]: Starting virus-scanner (amavisd-new):
apr 10 21:32:03 MAXLEAP160 amavis[4052]: Insecure directory in $ENV{PATH} while running with -T switch at /usr/lib/perl5/5.42.0/Net/Domain.pm line 173.
apr 10 21:32:03 MAXLEAP160 amavis[4052]: BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.42.0/Amavis/Conf.pm line 1038.
apr 10 21:32:03 MAXLEAP160 amavis[4052]: Compilation failed in require at /usr/lib/perl5/vendor_perl/5.42.0/Amavis.pm line 27.
apr 10 21:32:03 MAXLEAP160 amavis[4052]: BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.42.0/Amavis.pm line 27.
apr 10 21:32:03 MAXLEAP160 systemd[1]: amavis.service: Main process exited, code=exited, status=1/FAILURE

It seems that something is wrong with perl/amavis but really I don’t know what could be.

Insecure directory in $ENV{PATH}

You have a directory with too broad permissions set. No I don’t know what it is, it’ll be in the configuration file.

Maybe … but this is the content of $PATH :

MAXLEAP160:/var/log/clamav # echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

MAXLEAP160:/usr/lib/systemd/system # perl -e 'print join("\n", split(/:/,$ENV{PATH})), "\n"'
/usr/local/sbin
/usr/local/bin
/sbin
/bin
/usr/sbin
/usr/bin

and this is what I have (not touched) in /etc/amavis.conf :


$MYHOME = '/var/spool/amavis';
$TEMPBASE = "$MYHOME/tmp";   # working directory, needs to exist, -T
$ENV{TMPDIR} = $TEMPBASE;    # environment variable TMPDIR, used by SA, etc.

Directories exist according to this output :

MAXLEAP160:/usr/lib/systemd/system # ls -l /var/spool/amavis
totale 16
drwxr-x---. 2 vscan vscan 4096 12 ago  2023 db
drwxr-x---. 2 vscan vscan 4096 12 ago  2023 tmp
drwxr-x---. 2 vscan vscan 4096 12 ago  2023 var
drwxr-x---. 2 vscan vscan 4096 12 ago  2023 virusmails

/sbin and /bin are probably links to /usr/sbin and /usr/bin respectively. They have permissions of 777.

Set the path for amavisd and remove /bin and /sbin and see if that does it.

You should start by reading the documentation. The default provided config file is probably completely useless.

I’ve tried to set PATH variable but with no result.

Added this line to /usr/lib/systemd/system/amavis.service :
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
Added this line to /etc/amavisd.conf :
$ENV{PATH} = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin";

In both cases I get the same error.

In amavis documentation I really didn’t find any point speaking of PATH.

I’ve a working mail server with openSUSE 15.4 and I’m testing the same in a VM with Leap16.0 before making a migration.
The amavis version provided with Leap16.0 was compiled on 08/2023 so
IMHO the issue could derive from an up-to-date version of perl.

On a new Leap 16.0 installation with SELinux in enforcing mode there is still a problem to start amavis https://bugzilla.opensuse.org/show_bug.cgi?id=1254438 .
But when SELinux is disabled or set to permissive mode it does start on my test vm with unchanged default settings:

systemctl status  amavis.service 
● amavis.service - Amavisd-new Virus Scanner interface
     Loaded: loaded (/usr/lib/systemd/system/amavis.service; enabled; preset: disabled)
     Active: active (running) since Sat 2026-04-11 11:47:11 CEST; 10min ago
 Invocation: 1f774a1fd17444e8ac351c0c5d05603d
   Main PID: 1479 (/usr/sbin/amavi)
     Status: "Starting child process(es), ready for work."
      Tasks: 3 (limit: 4524)
        CPU: 1.478s
     CGroup: /system.slice/amavis.service
             ├─1479 "/usr/sbin/amavisd (master)"
             ├─1484 "/usr/sbin/amavisd (virgin child)"
             └─1485 "/usr/sbin/amavisd (virgin child)"

Thanks for reply.
I tried SELinux in permissive mode and even disabled but I get the same result.
I really have no other idea …

Could you check with

rpm -V amavisd-new
rpm -V perl

that the checksums of amavis and perl5 are ok.

I changed approach …
I created a new VM with leap-16 , I installed amavis and didn’t modify any configuration files :

  • with selinux enabled it doesn’t start but the error is different (permission denied on unix sockect) … a new hope arise
  • with selinux disabled it starts … so there is life on amavis :grinning:

Now I’ve to investigate on what services/setting lead to this issue.

I’ve found that exists a bug
with a simple workaround …
Solved

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.