How can I fix the error: Can't connect to TCP port 10024 on 127.0.0.0 [Address already in use] when trying to start Amavis?

Overview

This article provides the procedure to resolve the "Address already in use" error encountered when starting the Amavis mail filter service. This issue typically occurs when orphaned or stale processes retain control of TCP port 10024, preventing new instances from binding successfully.

Error Symptoms

The following error message appears in the system mail log during service initialization:

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 127.0.0.0 [Address already in use]\n  at line 68 in file /usr/share/perl5/vendor_perl/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 privileges on the target server.
  • Access to a command-line terminal session.

Resolution Steps

To restore normal operation, terminate all existing Amavis and Amavisd-milter processes, then restart the services according to your operating system distribution.

  1. Identify Active Processes: Execute the following command to list all running processes associated with the amavis user. Record the Process IDs (PIDs) displayed in the output.
    ps aux | grep amavis
    amavis    326354  0.2  0.2 833528 356948 ?       S    03:10   0:03 /usr/sbin/amavisd (ch10-avail)
    amavis    326355  0.2  0.2 831928 354688 ?       S    03:10   0:03 /usr/sbin/amavisd (ch9-avail)
    amavis    326366  0.1  0.2 827004 347424 ?       S    03:10   0:02 /usr/sbin/amavisd (ch5-avail)
    amavis   2222593  0.0  0.0 2214520 4876 ?        Ssl  Oct23   6:30 /usr/sbin/amavisd-milter -s inet:10024@127.0.0.1 -m 0 -M 300 -t 600 -T 600 -B -P
  2. Terminate Stale Processes: Forcefully terminate the identified processes by replacing the example PIDs with those retrieved from your system.
    kill -9 326354 326355 326366 2222593
  3. Restart Services: Restart the Amavis and Amavisd-milter services using the commands appropriate for your distribution.

    AlmaLinux/CloudLinux/RHEL

    systemctl restart amavisd
    systemctl restart amavisd-milter

    Debian/Ubuntu

    systemctl restart amavis
    systemctl restart amavisd-milter

Troubleshooting

  • If the service fails to start after executing these steps, verify that no other application is bound to port 10024 by running: ss -tlnp | grep 10024.
  • Ensure that local loopback network interfaces are functioning correctly and not restricted by firewall rules.
  • restart
  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

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