1

Topic: Amavisd package update on CentOS 7 - 9/03/2020 (RESOLVED)

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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 wanted to share this in-case anyone else encounters the issue. Feel free to delete/move the post if this is in the wrong area.

The amavisd package has changed in today's "yum" updates. If you have package updates running on a cron, this will break mail delivery. Basically, the new package disables/stops the amavisd service. The simple fix is to restart and enable the service again:


Sep 03 14:00:14 Installed: amavis-2.12.0-9.el7.noarch
Sep 03 14:00:15 Erased: amavisd-new-2.11.1-1.el7.noarch

systemctl enable amavisd.service
systemctl start amavisd.service

----

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

2 (edited by ms2504 2020-09-04 21:18:09)

Re: Amavisd package update on CentOS 7 - 9/03/2020 (RESOLVED)

Thanks a lot for sharing this!!

I run into this same issue, rebooted the server but still not working. 

Then I started manually the service, but did'nt notice that it was not set to start at boot.

Maybe it needs to be notified to those who run CentOS 7.. if you don't check mailq, the server is down and you don't notice it because dovecot,imap,pop3 are up, so it seems to run.

3

Re: Amavisd package update on CentOS 7 - 9/03/2020 (RESOLVED)

I sent this to mailing list:
https://groups.google.com/g/iredmail/c/lZSaAqtEEOc

4

Re: Amavisd package update on CentOS 7 - 9/03/2020 (RESOLVED)

Thanks for the message sent via Google Groups.

I have yum-updated and enabled/started the service as per the instructions.
All good.

I have noticed however that amavisd-release complains with the following.

Can't connect to UNIX socket /run/amavisd/amavisd.sock: No such file or directory at /usr/bin/amavisd-release line 271.

TL;DR - there is a config mismatch in the new amavisd-release script vs the iRedmail setting.

------
Investigation:
Grepping for that name in the config files, I find 2 hits:

/etc/amavisd/amavisd.conf.rpmnew: $unix_socketname = "/run/amavisd/amavisd.sock";  # amavisd-release or amavis-milter
/etc/amavisd/amavisd.conf: $unix_socketname = '/var/run/amavisd/amavisd.socket';

The first is the rpmnew file added with the yum update, so would be the default config.
The second is the iRedmail supplied file.
The difference is the "/var" prefix and the tail ".sock" is ".socket" in iRedmail.

Checking the service running on the server, I can see the new amavisd is running using the iRedmail file name/path.

lsof | grep /run/amavisd/amavisd.sock
/usr/sbin 29537  amavis 7u  unix 0xffff89f1b631a640  0t0  24492504 /var/run/amavisd/amavisd.socket
/usr/sbin 29544  amavis 7u  unix 0xffff89f1b631a640  0t0  24492504 /var/run/amavisd/amavisd.socket
/usr/sbin 29545  amavis 7u  unix 0xffff89f1b631a640  0t0  24492504 /var/run/amavisd/amavisd.socket
/usr/sbin 29546  amavis 7u  unix 0xffff89f1b631a640  0t0  24492504 /var/run/amavisd/amavisd.socket
/usr/sbin 29547  amavis 7u  unix 0xffff89f1b631a640  0t0  24492504 /var/run/amavisd/amavisd.socket

According to /var/log/maillog, amavis seems to be processing emails ok.

Further investigation showed I had 2 "amavisd-release" files (see below):

-rwxr-xr-x 1 root root 12647 Aug 19 01:45 /usr/bin/amavisd-release
-rwxr-xr-x 1 root root 12655 Oct 19  2018 /usr/bin/amavisd-release-orig

As they were perl scripts, a diff revealed there is a configuration referencing the $socketname on line 90.

$socketname = '/run/amavisd/amavisd.sock';
$socketname = '/var/run/amavisd/amavisd.socket';

So it would seem I have come across this issue before ??    and resolved it by editing the amavisd-release script.

I see that /var/run is a symlink to /run, so the "/var" prefix in the config is not required.

I have a decision to make.  Do I update the amavisd-release script, adding the "/var" and the trailing "et" (as in socket) or do I update the /etc/amavisd/amavisd.conf to use the default value.
I have chosen to use the default.

So my socket name in /etc/amavisd/amavisd.conf is now:

$unix_socketname = '/run/amavisd/amavisd.sock';

This is the only change I made, and it means that any future updates to Amavis via the EPEL repo wil not break parts of Amavis.

My Amavisd process now looks like this:

lsof | grep /run/amavisd/amavisd.sock
/usr/sbin  5457  amavis 7u  unix 0xffff89f1d7c9e640  0t0 24849593 /run/amavisd/amavisd.sock
/usr/sbin  5518  amavis 7u  unix 0xffff89f1d7c9e640  0t0 24849593 /run/amavisd/amavisd.sock
/usr/sbin  5519  amavis 7u  unix 0xffff89f1d7c9e640  0t0 24849593 /run/amavisd/amavisd.sock
/usr/sbin  5520  amavis 7u  unix 0xffff89f1d7c9e640  0t0 24849593 /run/amavisd/amavisd.sock
/usr/sbin  5521  amavis 7u  unix 0xffff89f1d7c9e640  0t0 24849593 /run/amavisd/amavisd.sock

-----

I would ask that ZHB review the iRedmail implementation of Amavisd to ensure amavisd-release works in a fresh-built iRedmail system.

Thanks, Rob.

5 (edited by Bronko 2020-09-08 18:27:03)

Re: Amavisd package update on CentOS 7 - 9/03/2020 (RESOLVED)

rob.ired wrote:

The difference is the "/var" prefix and the tail ".sock" is ".socket" in iRedmail.

Doesn't saw the '.sock' mismatch in my CentOS 7 setup but to remove the prefix '/var' in '/etc/amavisd/amavisd.conf' would be purposeful but not necessary.