1 (edited by bolerules 2023-06-20 15:20:17)

Topic: Amavis-Clamav issue

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

Hi there... I'm having an issue with AMAVIS AND CLAMAV...
I'm running Ubuntu 20.04 LTS...
ClamAV 0.103.8/26944
amavisd-new-2.11.0 (20160426)

After running an update of FRESHCLAM & CLAMAV i ran into an issue...
Once I disable CLAMAV in AMAVIS everything is fine...

It seems that amavis cannot call/start clamav for mail scanning...

Here is my log mail log...

(!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory

(!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory

Jun 19 12:27:01 mail amavis[2327]: (02327-02) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection refused

Jun 19 12:27:01 mail amavis[2327]: (02327-02) (!)clamav-socket: All attempts (1) failed connecting to /var/run/clamav/clamd.ctl, retrying (2)

If someone can help it would be great! smile

Thanks,
Bole

----

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

2

Re: Amavis-Clamav issue

Please... anyone... smile

3

Re: Amavis-Clamav issue

how did you update clamav?
it seems it uses antoher config file now, where the socket is located somewhere else:

find / -name clamd.ctl

if it is not located in /run/clamav/clamd.ctl, then trough update of clamav, another config file is loaded and thus the location has changed

the file should be located at:
/etc/clamav/clamd.conf

Check if this exists:
LocalSocket /var/run/clamav/clamd.ctl

If not, add/edit it and restart it

4

Re: Amavis-Clamav issue

Thanks a lot man... I fixed it eventually...

I don't know if it means something to other iRedMail folks but it appears after updating clamav version amavis conf file 50-user was not updated accordingly... or something like that...

Line in 50-user was like this... before updating clamav...
@av_scanners = (
    ['clamav-socket',
    \&ask_daemon, ["CONTSCAN {}\n", '/var/run/clamd.ctl'],
    qr/\bOK$/m,
    qr/\bFOUND$/m,
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],
);

After updating clamav it appears that clamd.ctl has been moved to clamav folder...

It should be like this... at least it worked for me...

@av_scanners = (
    ['clamav-socket',
    \&ask_daemon, ["CONTSCAN {}\n", '/var/run/clamav/clamd.ctl'],
    qr/\bOK$/m,
    qr/\bFOUND$/m,
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],
);

Anyway, thanks a lot for your time and assistance... smile

Cheers,
Bole

5

Re: Amavis-Clamav issue

Thanks for sharing. smile