1

Topic: Amavis is not working on ubuntu 22.04

Hi, I had an ubuntu server 20.04 with almost nothing installed and
decided to upgrade the server to install the latest version of iredmail (1.6.2)


I upgraded the server to ubuntu 22.04, restarted the server,
then I installed iredmail 1.6.2 from the link in the site (1.6.2.tar.gz)

I restarted the server again, and I can login to the iredadmin, roundcube, etc, but I can't send emails,


I have inistalled iredmail so many times and I have never seen this error.
When I send an email, I see this in the logs:
Dec 24 14:11:28 lserver postfix/amavis/smtp[19539]: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused
Dec 24 14:11:28 lserver postfix/amavis/smtp[19539]: 4NfYYr184pz2cPkC: to=<usertest@gmail.com>, relay=none, delay=0.09, delays=0.08/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)

This made me realize amavis is not working

I see this when I try to start amavis (It's weird because I have another iredmail installed in another ubuntu 22.04 and  this server has the same permissions in folders and files)

sudo amavisd-new start
Error in config file "/etc/amavis/conf.d/05-domain_id": Insecure directory in $ENV{PATH} while running with -T switch at /etc/amavis/conf.d/05-domain_id line 7.

I also see this error when I execute this command:
sudo amavisd-new -c /etc/amavis/conf.d/50-user debug
Dec 24 13:52:09.178 /usr/sbin/amavisd-new[35783]: logging initialized, log level 0, syslog: amavis.mail
Dec 24 13:52:09.178 /usr/sbin/amavisd-new[35783]: sd_notify (no socket): STATUS=Config files have been read, modules loaded.
Dec 24 13:52:09.178 /usr/sbin/amavisd-new[35783]: starting. /usr/sbin/amavisd-new at server.testdomain.com amavisd-new-2.12.2 (20211013), Unicode aware, LANG="en_US.UTF-8"
Dec 24 13:52:09.178 /usr/sbin/amavisd-new[35783]: perl=5.034000, user=, EUID: 120 (120);  group=, EGID: 127 127 (127 127)
Dec 24 13:52:09.205 /usr/sbin/amavisd-new[35783]: INFO: no optional modules: utf8_heavy.pl unicore::lib::Nt::De.pl unicore::Heavy.pl Unix::Getrusage
Dec 24 13:52:09.205 /usr/sbin/amavisd-new[35783]: SpamControl: attempting to load scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
Dec 24 13:52:09.205 /usr/sbin/amavisd-new[35783]: SpamControl: scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
Dec 24 13:52:09.362 /usr/sbin/amavisd-new[35783]: INFO: SA version: 3.4.6, 3.004006, no optional modules: Encode::Detect Razor2::Client::Agent Image::Info Image::Info::GIF Image::Info::JPEG Image::Info::PNG Image::Info::BMP Image::Info::TIFF
Dec 24 13:52:09.362 /usr/sbin/amavisd-new[35783]: SpamControl: init_pre_chroot on SpamAssassin done
Dec 24 13:52:09.362 /usr/sbin/amavisd-new[35783]: socket module IO::Socket::IP, protocol families available: INET, INET6
Dec 24 13:52:09.363 /usr/sbin/amavisd-new[35783]: will bind to /var/run/amavis/amavisd.socket|unix, 127.0.0.1:10024/tcp, 127.0.0.1:10026/tcp, 127.0.0.1:10027/tcp, 127.0.0.1:9998/tcp
Dec 24 13:52:09.364 /usr/sbin/amavisd-new[35783]: sd_notify (no socket): STATUS=Transferring control to Net::Server.
Dec 24 13:52:09.364 /usr/sbin/amavisd-new[35783]: (!)Net::Server: 2022/12/24-13:52:09 Couldn't open pid file "/var/run/amavis/amavisd.pid" [No such file or directory].\n\n  at line 177 in file /usr/share/perl5/Net/Server.pm
Dec 24 13:52:09.364 /usr/sbin/amavisd-new[35783]: sd_notify (no socket): STOPPING=1\nSTATUS=Server rundown, notifying child processes.
Dec 24 13:52:09.364 /usr/sbin/amavisd-new[35783]: Net::Server: 2022/12/24-13:52:09 Server closing!
Dec 24 13:52:09.364 /usr/sbin/amavisd-new[35783]: sd_notify (no socket): STATUS=Child processes have been stopped.


More info (My domain is not really domaintest.com, this is just an example)
cat /etc/mailname
lserver.domaintest.com

cat /etc/hosts
127.0.0.1 localhost
192.168.254.200 lserver.domaintest.com lserver
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

hostname -f
lserver.domaintest.com


sudo /etc/init.d/amavis status
× amavis.service - Interface between MTA and virus scanner/content filters
     Loaded: loaded (/lib/systemd/system/amavis.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-12-24 14:04:45 EST; 12min ago     
    Process: 10653 ExecStartPre=/usr/bin/find /var/lib/amavis -maxdepth 1 -name amavis-* -type d -exec rm -rf {} ; (code=exited, status=0/SUCCESS)
    Process: 10660 ExecStartPre=/usr/bin/find /var/lib/amavis/tmp -maxdepth 1 -name amavis-* -type d -exec rm -rf {} ; (code=exited, status=0/SUCCESS)
    Process: 10663 ExecStart=/usr/sbin/amavisd-new foreground (code=exited, status=255/EXCEPTION)
   Main PID: 10663 (code=exited, status=255/EXCEPTION)
        CPU: 629ms

Dec 24 14:04:45 lserver systemd[1]: amavis.service: Scheduled restart job, restart counter is at 5.
Dec 24 14:04:45 lserver systemd[1]: Stopped Interface between MTA and virus scanner/content filters.
Dec 24 14:04:45 lserver systemd[1]: amavis.service: Start request repeated too quickly.
Dec 24 14:04:45 lserver systemd[1]: amavis.service: Failed with result 'exit-code'.
Dec 24 14:04:45 lserver systemd[1]: Failed to start Interface between MTA and virus scanner/content filters.

I also have checked that the amavis can connect to the mariadb database and also all theother apps like iredmail and roundcube (I can create users in iredadmin and log in using roundcube, I just can't send or receive emails
because amavis is just not working )

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by avhernandezx 2022-12-25 09:31:52)

Re: Amavis is not working on ubuntu 22.04

Hi guys, I found the problem,
I am posting the solution in case it happens to any other user
my /usr/local/bin directory had 777 permissions (That was me when creating some local scripts)
I just changed it to 755 and started amavis and all good now
This links helped me:
bugs.launchpad.net/ubuntu/+source/amavisd-new/+bug/251377

3

Re: Amavis is not working on ubuntu 22.04

Thanks for sharing. smile