1

Topic: Can't connect to UNIX socket amavisd.sock

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.8
- Deployed with iRedMail Easy or the downloadable installer? Downloaded
- Linux/BSD distribution name and version: Ubuntu 20.04.06
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I have an email that is sitting in quarantine for about 3 days. Now that I'm trying to release it with amavisd-release, I get this error:

Can't connect to UNIX socket /var/lib/amavis/amavisd.sock: No such file or directory at /usr/sbin/amavisd-release line 271.

Clamav is running fine, and I can't find any errors in logs. Amavisd-new service is reported running fine.
I have already tried to reboot the system, but the situation hasn't changed.

I'm open for suggestion where to find more logs/reports that can help diagnose/resolve this problem.
Many thanks in advance

----

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

2

Re: Can't connect to UNIX socket amavisd.sock

file should be /run/amavis/amavisd.socket (at least in my case)

check if it is in this place

but i aswell checked, and in /etc/amavis/conf.d/25-amavis_helpers

##
## Functionality required for amavis helpers like
## amavis-release.
##

# Enable required AM.PDP protocol socket.
#
# this is incompatible with the old helpers, but one can
# have multiple inet (not unix) sockets to overcome this
# issue.  Refer to the amavisd-new documentation for more
# information

$unix_socketname = "/var/lib/amavis/amavisd.sock";

$interface_policy{'SOCK'} = 'AM.PDP-SOCK';
$policy_bank{'AM.PDP-SOCK'} = {
  protocol => 'AM.PDP',
  auth_required_release => 0, # don't require secret-id for release
};

strangely, it doesn't create the socket in the designated directory

you can try and change the location in the config file, restart it and test if it works now, but no gurantee

3

Re: Can't connect to UNIX socket amavisd.sock

I think the parameter
$unix_socketname = "/var/lib/amavis/amavisd.sock";  is the default in the file /etc/amavis/conf.d/25-amavis_helpers  but it is overwritten by the parameter 

$unix_socketname = '/var/run/amavis/amavisd.socket';  in /etc/amavis/conf-d/50-user.

I have /var/run/amavis/amavis.socket  and not the first one.

by the way, try     systemctl status amavis   is it running?

"amavisd-new" do not exist anymore, neither amavisd. 
It was renamed simply to "amavis" a couple of years ago.

4

Re: Can't connect to UNIX socket amavisd.sock

Hi all,
thanks both of you for the help. Really appreciated.
I managed to resolve the issue.

Cthulhu wrote:

file should be /run/amavis/amavisd.socket (at least in my case)

Yes, I found the file there.


Cthulhu wrote:

but i aswell checked, and in /etc/amavis/conf.d/25-amavis_helpers

and the config file was the same for me.

I edited it with the new file path and restarted amavis service, but nothing changed.

I had to edit /usr/sbin/amavisd-release at line 127, and I entered the new file location:

BEGIN {
### USER CONFIGURABLE:

  $log_level = 1;
# $socketname = '127.0.0.1:9998';
# $socketname = '[::1]:9998';
  $socketname = '/run/amavis/amavisd.socket';         # < -- Here new file path of amavisd.socket

### END OF USER CONFIGURABLE
}

Now amavisd-release is working as intended.

===================================================

ms2504 wrote:

I think the parameter
$unix_socketname = "/var/lib/amavis/amavisd.sock";  is the default in the file /etc/amavis/conf.d/25-amavis_helpers  but it is overwritten by the parameter

$unix_socketname = '/var/run/amavis/amavisd.socket';  in /etc/amavis/conf-d/50-user.

I didn't try it, I don't know if it would have worked.

ms2504 wrote:

by the way, try     systemctl status amavis   is it running?

Yup, it was running fine. Nothing to report.

ms2504 wrote:

"amavisd-new" do not exist anymore, neither amavisd.
It was renamed simply to "amavis" a couple of years ago.

You're right, bad habit of mine to still call it amavisd.