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.
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
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)"