Amavis can't find perl modules so it does not work anymore

Pau Peris sibok1981 at gmail.com
Mon Oct 18 10:47:32 CEST 2021


I'm running amavis 20160426 on Ubuntu 20.04 and suddenly it stopped
working. It looks like it is failing to find/read some perl modules.
Is there anybody who knows how to fix it? Thanks a lot in advanced! :)

Ubuntu version:

    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 20.04.1 LTS
    Release: 20.04
    Codename: focal


Amavis version:

    amavisd-new -V
    amavisd-new-2.11.0 (20160426)


Running telnet to amavis port:

    telnet localhost 10024
        Trying 127.0.0.1...
        Trying 127.0.1.1...
        Trying ::1...
        telnet: Unable to connect to remote host: Connection refused

netstat -tap | grep -i amavis output is emtpy.


Running amavisd-new in debug mode shows the following `amavisd-new debug`

    Variable $syslog_priority was retired, changing its value has no
effect. See release notes.
     at /etc/amavis/conf.d/50-user line 12.
    Oct 13 12:28:41.590 we.example.es /usr/sbin/amavisd-new[1699170]:
logging initialized, log level 0, syslog: amavis.mail
    Oct 13 12:28:41.590 we.example.es /usr/sbin/amavisd-new[1699170]:
sd_notify (no socket): STATUS=Config files have been read, modules
loaded.
    Oct 13 12:28:41.590 we.example.es /usr/sbin/amavisd-new[1699170]:
starting. /usr/sbin/amavisd-new at we.example.es amavisd-new-2.11.0
(20160426), Unicode aware, LC_ALL="en_US.UTF-8", LC_CTYPE="UTF-8",
LANG="en_US.UTF-8"
    Oct 13 12:28:41.590 we.example.es /usr/sbin/amavisd-new[1699170]:
perl=5.030000, user=, EUID: 111 (111);  group=, EGID: 115 115 (115
115)
    Oct 13 12:28:41.629 we.example.es /usr/sbin/amavisd-new[1699170]:
INFO: no optional modules: unicore::lib::Nt::De.pl Unix::Getrusage
    Oct 13 12:28:41.629 we.example.es /usr/sbin/amavisd-new[1699170]:
SpamControl: attempting to load scanner SpamAssassin, module
Amavis::SpamControl::SpamAssassin
    Oct 13 12:28:41.629 we.example.es /usr/sbin/amavisd-new[1699170]:
SpamControl: scanner SpamAssassin, module
Amavis::SpamControl::SpamAssassin
    fetch_modules: error loading optional module Razor2/Client/Agent.pm:
      Can't locate Getopt/Long.pm:   lib/Getopt/Long.pm: Permission
denied at /usr/share/perl5/Razor2/Client/Agent.pm line 15.
      BEGIN failed--compilation aborted at
/usr/share/perl5/Razor2/Client/Agent.pm line 15.
      Compilation failed in require at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/DKIM.pm:
      Can't locate Mail/DKIM.pm:   lib/Mail/DKIM.pm: Permission denied
at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Image/Info.pm:
      Can't locate Image/Info.pm:   lib/Image/Info.pm: Permission
denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Image/Info/GIF.pm:
      Can't locate Image/Info/GIF.pm:   lib/Image/Info/GIF.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Image/Info/JPEG.pm:
      Can't locate Image/Info/JPEG.pm:   lib/Image/Info/JPEG.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Image/Info/PNG.pm:
      Can't locate Image/Info/PNG.pm:   lib/Image/Info/PNG.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Image/Info/BMP.pm:
      Can't locate Image/Info/BMP.pm:   lib/Image/Info/BMP.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Image/Info/TIFF.pm:
      Can't locate Image/Info/TIFF.pm:   lib/Image/Info/TIFF.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF.pm:
      Can't locate Mail/SPF.pm:   lib/Mail/SPF.pm: Permission denied
at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Server.pm:
      Can't locate Mail/SPF/Server.pm:   lib/Mail/SPF/Server.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Request.pm:
      Can't locate Mail/SPF/Request.pm:   lib/Mail/SPF/Request.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech.pm:
      Can't locate Mail/SPF/Mech.pm:   lib/Mail/SPF/Mech.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/A.pm:
      Can't locate Mail/SPF/Mech/A.pm:   lib/Mail/SPF/Mech/A.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/PTR.pm:
      Can't locate Mail/SPF/Mech/PTR.pm:   lib/Mail/SPF/Mech/PTR.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/All.pm:
      Can't locate Mail/SPF/Mech/All.pm:   lib/Mail/SPF/Mech/All.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/Exists.pm:
      Can't locate Mail/SPF/Mech/Exists.pm:
lib/Mail/SPF/Mech/Exists.pm: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/IP4.pm:
      Can't locate Mail/SPF/Mech/IP4.pm:   lib/Mail/SPF/Mech/IP4.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/IP6.pm:
      Can't locate Mail/SPF/Mech/IP6.pm:   lib/Mail/SPF/Mech/IP6.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/Include.pm:
      Can't locate Mail/SPF/Mech/Include.pm:
lib/Mail/SPF/Mech/Include.pm: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mech/MX.pm:
      Can't locate Mail/SPF/Mech/MX.pm:   lib/Mail/SPF/Mech/MX.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mod.pm:
      Can't locate Mail/SPF/Mod.pm:   lib/Mail/SPF/Mod.pm: Permission
denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mod/Exp.pm:
      Can't locate Mail/SPF/Mod/Exp.pm:   lib/Mail/SPF/Mod/Exp.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/Mod/Redirect.pm:
      Can't locate Mail/SPF/Mod/Redirect.pm:
lib/Mail/SPF/Mod/Redirect.pm: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/SenderIPAddrMech.pm:
      Can't locate Mail/SPF/SenderIPAddrMech.pm:
lib/Mail/SPF/SenderIPAddrMech.pm: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/v1/Record.pm:
      Can't locate Mail/SPF/v1/Record.pm:   lib/Mail/SPF/v1/Record.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Mail/SPF/v2/Record.pm:
      Can't locate Mail/SPF/v2/Record.pm:   lib/Mail/SPF/v2/Record.pm:
Permission denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module auto/NetAddr/IP/_compV6.al:
      Can't locate auto/NetAddr/IP/_compV6.al:
lib/auto/NetAddr/IP/_compV6.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module auto/NetAddr/IP/short.al:
      Can't locate auto/NetAddr/IP/short.al:
lib/auto/NetAddr/IP/short.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/NetAddr/IP/InetBase/inet_any2n.al:
      Can't locate auto/NetAddr/IP/InetBase/inet_any2n.al:
lib/auto/NetAddr/IP/InetBase/inet_any2n.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/NetAddr/IP/InetBase/inet_n2ad.al:
      Can't locate auto/NetAddr/IP/InetBase/inet_n2ad.al:
lib/auto/NetAddr/IP/InetBase/inet_n2ad.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/NetAddr/IP/InetBase/inet_n2dx.al:
      Can't locate auto/NetAddr/IP/InetBase/inet_n2dx.al:
lib/auto/NetAddr/IP/InetBase/inet_n2dx.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/NetAddr/IP/InetBase/inet_ntoa.al:
      Can't locate auto/NetAddr/IP/InetBase/inet_ntoa.al:
lib/auto/NetAddr/IP/InetBase/inet_ntoa.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/NetAddr/IP/InetBase/ipv6_aton.al:
      Can't locate auto/NetAddr/IP/InetBase/ipv6_aton.al:
lib/auto/NetAddr/IP/InetBase/ipv6_aton.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/NetAddr/IP/InetBase/ipv6_ntoa.al:
      Can't locate auto/NetAddr/IP/InetBase/ipv6_ntoa.al:
lib/auto/NetAddr/IP/InetBase/ipv6_ntoa.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/Crypt/OpenSSL/RSA/new_key_from_parameters.al:
      Can't locate auto/Crypt/OpenSSL/RSA/new_key_from_parameters.al:
 lib/auto/Crypt/OpenSSL/RSA/new_key_from_parameters.al: Permission
denied at /usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/Crypt/OpenSSL/RSA/get_key_parameters.al:
      Can't locate auto/Crypt/OpenSSL/RSA/get_key_parameters.al:
lib/auto/Crypt/OpenSSL/RSA/get_key_parameters.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module
auto/Crypt/OpenSSL/RSA/import_random_seed.al:
      Can't locate auto/Crypt/OpenSSL/RSA/import_random_seed.al:
lib/auto/Crypt/OpenSSL/RSA/import_random_seed.al: Permission denied at
/usr/sbin/amavisd-new line 210.
    fetch_modules: error loading optional module Error.pm:
      Can't locate Error.pm:   lib/Error.pm: Permission denied at
/usr/sbin/amavisd-new line 210.
    Oct 13 12:28:41.799 we.example.es /usr/sbin/amavisd-new[1699170]:
INFO: SA version: 3.4.4, 3.004004, no optional modules: Encode::Detect
Razor2::Client::Agent Mail::DKIM Image::Info Image::Info::GIF
Image::Info::JPEG Image::Info::PNG Image::Info::BMP Image::Info::TIFF
Mail::SPF Mail::SPF::Server Mail::SPF::Request Mail::SPF::Mech
Mail::SPF::Mech::A Mail::SPF::Mech::PTR Mail::SPF::Mech::All
Mail::SPF::Mech::Exists Mail::SPF::Mech::IP4 Mail::SPF::Mech::IP6
Mail::SPF::Mech::Include Mail::SPF::Mech::MX Mail::SPF::Mod
Mail::SPF::Mod::Exp Mail::SPF::Mod::Redirect
Mail::SPF::SenderIPAddrMech Mail::SPF::v1::Record
Mail::SPF::v2::Record auto::NetAddr::IP::_compV6
auto::NetAddr::IP::short auto::NetAddr::IP::InetBase::inet_any2n
auto::NetAddr::IP::InetBase::inet_n2ad
auto::NetAddr::IP::InetBase::inet_n2dx
auto::NetAddr::IP::InetBase::inet_ntoa
auto::NetAddr::IP::InetBase::ipv6_aton
auto::NetAddr::IP::InetBase::ipv6_ntoa
auto::Crypt::OpenSSL::RSA::new_key_from_parameters
auto::Crypt::OpenSSL::RSA::get_key_parameters
auto::Crypt::OpenSSL::RSA::import_random_seed Error
    Oct 13 12:28:41.800 we.example.es /usr/sbin/amavisd-new[1699170]:
SpamControl: init_pre_chroot on SpamAssassin done
    Oct 13 12:28:41.800 we.example.es /usr/sbin/amavisd-new[1699170]:
socket module IO::Socket::IP, protocol families available: INET, INET6
    Oct 13 12:28:41.800 we.example.es /usr/sbin/amavisd-new[1699170]:
will bind to /var/lib/amavis/amavisd.sock|unix, 127.0.0.1:10024/tcp,
[::1]:10024/tcp
    Oct 13 12:28:41.800 we.example.es /usr/sbin/amavisd-new[1699170]:
sd_notify (no socket): STATUS=Transferring control to Net::Server.
    Oct 13 12:28:41.801 we.example.es /usr/sbin/amavisd-new[1699170]:
sd_notify (no socket): STATUS=Preparing to bind sockets.
    Oct 13 12:28:41.801 we.example.es /usr/sbin/amavisd-new[1699170]:
Net::Server: 2021/10/13-12:28:41 Amavis (type
Net::Server::PreForkSimple) starting! pid(1699170)
    Oct 13 12:28:41.801 we.example.es /usr/sbin/amavisd-new[1699170]:
(!)Net::Server: 2021/10/13-12:28:41 Unresolveable host [::1]:10024 -
could not load IO::Socket::INET6: Can't locate IO/Socket/INET6.pm:
lib/IO/Socket/INET6.pm: Permission denied at
/usr/share/perl5/Net/Server/Proto.pm line 118.\n\n  at line 78 in file
/usr/share/perl5/Net/Server/Proto.pm
    Oct 13 12:28:41.801 we.example.es /usr/sbin/amavisd-new[1699170]:
sd_notify (no socket): STOPPING=1\nSTATUS=Server rundown, notifying
child processes.
    Oct 13 12:28:41.801 we.example.es /usr/sbin/amavisd-new[1699170]:
Net::Server: 2021/10/13-12:28:41 Server closing!
    Oct 13 12:28:41.801 we.example.es /usr/sbin/amavisd-new[1699170]:
sd_notify (no socket): STATUS=Child processes have been stopped.

Chroot into amavis:

    # su - amavis
    $ perl -e 'use Mail :: DKIM;'
    Can't locate Mail.pm in @INC (you may need to install the Mail
module) (@INC contains: /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0
/usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30
/usr/share/perl/5.30 /usr/local/lib/site_perl
/usr/lib/x86_64-linux-gnu/perl-base) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.

    $ pwd
    /var/lib/amavis

    $ ls /usr/local/lib/x86_64-linux-gnu/perl/5.30.0/
    Alien  auto  Bit  Compress  Date  Digest  perllocal.pod  POD2
Text  Unicode  XML
    $ ls /usr/lib/x86_64-linux-gnu/perl5/5.30
    Algorithm  B    Class     Crypt    Devel    IO     Net      re
  Socket6.pm  Type     Win32
    AptPkg    BerkeleyDB    Clone.pm  DBD    FCGI.pm  JSON    NetAddr
Ref      Sort   Unicode   XML
    AptPkg.pm  BerkeleyDB.pm   common    DBI    File     Linux
Package  RRDs.pm  Sub   Unix     YAML
    Authen    BerkeleyDB.pod  Convert   DBI.pm    Hash     List
Params   Scalar   Term   Variable
    auto    Bundle    Cpanel    dbixs_rev.pl  HTML     Locale  PerlIO
 Sereal   Text   Want.pm

The following is the list of installed packages, in case someone can
check wether a package is not installed due to a broken dependency
bug.

https://pastebin.com/5gyiajmZ

-- 
Pau


More information about the amavis-users mailing list