How can I fix the error: Can't connect to TCP port 10024 on ::1 [Cannot assign requested address] when trying to start Amavis?

Overview

This article addresses a startup failure for the Amavis mail filter service caused by an inability to bind to TCP port 10024 on the IPv6 loopback address (::1). This error typically occurs when the server environment restricts or lacks IPv6 support, causing Amavis to fail during initialization. The following log entry indicates this issue:

Oct 02 03:20:15 condor3648 systemd[1]: Starting LSB: Starts amavisd-new mailfilter...
Oct 02 03:20:16 condor3648 amavis[1697]: starting. /usr/sbin/amavisd-new at condor3648.startdedicated.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="en_US.UTF-8"
Oct 02 03:20:16 condor3648 amavis[1705]: (!)Net::Server: 2020/10/02-03:20:16 Can't connect to TCP port 10024 on ::1 [Cannot assign requested address]\n at line 64 in file /usr/share/perl5/Net/Server/Proto/TCP.pm
Oct 02 03:20:16 condor3648 amavis[1690]: Starting amavisd: amavisd-new.
Oct 02 03:20:16 condor3648 systemd[1]: Started LSB: Starts amavisd-new mailfilter.

Prerequisites

  • Root or sudo access to the server
  • Terminal access with a text editor (e.g., vi, nano)

Solution

To resolve this issue, configure Amavis to bind exclusively to the IPv4 loopback address. Follow the steps below according to your operating system:

  1. Edit the appropriate configuration file:
    • AlmaLinux/CloudLinux/RHEL: Open /etc/amavisd/warden.conf
    • Debian/Ubuntu: Open /etc/amavis/conf.d/99-warden
  2. Add the socket binding directive: Insert the following line into the configuration file:
    $inet_socket_bind = '127.0.0.1';
  3. Save and close the file.
  4. Restart the Amavis service: Execute the command corresponding to your distribution:
    • AlmaLinux/CloudLinux/RHEL:
      systemctl restart amavisd
    • Debian/Ubuntu:
      systemctl restart amavis

Troubleshooting

If the service fails to start after applying the configuration change, review the following common issues:

  • IPv6 Network Restrictions: If IPv6 is intentionally disabled at the OS level, this workaround ensures Amavis operates correctly on IPv4. Re-enabling IPv6 support may also resolve the binding conflict if required by other services.
  • restart
  • 5 ユーザーが役に立ったと判断
この回答は役に立ちましたか?

関連記事

How can I fix the error: Host '127.0.0.1' is not allowed to connect to this MariaDB server?

Overview This article provides resolution steps for the MariaDB connection error Host...

How can I fix the error: Parse error at /etc/clamav/clamd.conf Unknown option ScanImage?

Overview The clamav-daemon.service may fail to start due to unrecognized configuration...

How can I fix the error: The domain limit of this license key has been reached?

Overview The Admin and Pro editions of Danami products enforce a maximum domain limit within the...

After upgrading from Centos 7 to AlmaLinux 8 Amavis is treating mail with low scores as spam. How can I fix this?

Overview Following an upgrade from CentOS 7 to AlmaLinux 8, Amavis may incorrectly classify...