Amavis 版本使用 UNIX 套接字代替 inet tcp 套接字

Amavis 版本使用 UNIX 套接字代替 inet tcp 套接字

我尝试使用 Amavis-new 从隔离区释放一封电子邮件:

sudo /usr/sbin/amavisd-release MAIL_ID SECRET_ID

其中 MAIL_ID 和 SECRET_ID 是在数据库表“quarantine”中找到的 ID。

我在 Bash 中收到以下错误:

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

的内容/etc/amavis/conf.d/25-amavis_helpers为:

$unix_socketname = undef; #disable to unix socket

$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
};


# apply policy bank AM.PDP-INET to some inet tcp socket, e.g. tcp port 9998:
$inet_socket_port = [10024,9998];
$interface_policy{'9998'} = 'AM.PDP-INET';

$policy_bank{'AM.PDP-INET'} = {
  protocol => 'AM.PDP',  # select Amavis policy delegation protocol
  inet_acl => [qw( 127.0.0.1 [::1] )],  # restrict access to these IP addresses
  auth_required_release => 0,  # don't require secret_id for amavisd-release
};

Amavis-new 自动使用 UNIX 套接字。在 中禁用了 UNIX 套接字/etc/amavis/conf.d/25-amavis_helpers。在 中可以使用 inet tcp 套接字吗/usr/sbin/amavisd-release

答案1

我找到了一个解决方案。我将脚本复制/usr/sbin/amavisd-release到另一个文件夹,并将以下几行从

### USER CONFIGURABLE:

  $log_level = 1;
# $socketname = '127.0.0.1:9998';
# $socketname = '[::1]:9998';
  $socketname = '/var/lib/amavis/amavisd.sock';

### END OF USER CONFIGURABLE

### USER CONFIGURABLE:

  $log_level = 1;
  $socketname = '127.0.0.1:9998';
# $socketname = '[::1]:9998';
# $socketname = '/var/lib/amavis/amavisd.sock';

### END OF USER CONFIGURABLE

相关内容