1 (edited by macarotto 2020-07-14 05:58:42)

Topic: ClamAV can't parse freshclam.conf after adding proxy settings

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version: Ubuntu 18.04.4 LTS
- 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.
====

Hi, I've recently installed iRedMail on a Ubuntu server, and noticed ClamAV was failing to receive updates. The server is on a corporate network behind firewalls and has no direct web access, but I have configured proxy access for other services, things like apt, wget and curl are all working via the proxy with no issue.

I've looked at ClamAV's documentation, and some other pages (here, here and here amongst others) for advice.

I first tried manually updating /etc/clamav/freshclam.conf and adding the HTTPProxyServer, HTTPProxyPort, HTTPProxyUsername and HTTPProxyPassword fields, saving the file and restarting the freshclam service. Upon checking, I get "WARNING: Insecure permissions (for HTTPProxyPassword): /etc/clamav/freshclam.conf must have no more than 0700 permissions." The permissions on the file were set to 0444 as below:

-r--r--r--   1 clamav adm   958 Jul 13 16:08 freshclam.conf

Updating the permissions to 0700 and restarting the service then shows the below:

Jul 13 16:08:04 redmail01 systemd[1]: Started ClamAV virus database updater.
Jul 13 16:08:04 redmail01 freshclam[14551]: ERROR: Can't open/parse the config file /etc/clamav/freshclam.conf
Jul 13 16:08:04 redmail01 systemd[1]: clamav-freshclam.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 13 16:08:04 redmail01 systemd[1]: clamav-freshclam.service: Failed with result 'exit-code'.

As suggested in some of the threads linked, I tried running dpkg-reconfigure clamav-freshclam. I've gone through the on-screen setup, including the proxy server details, and it's auto-generated the freshclam.conf file. I've replaced my original file with the newly generated one, however this also causes freshclam to fail to start.

I'm currently stumped, as far I can tell I haven't missed anything or made any typos in the config file, but it just doesn't seem to work at all. I've had to comment out the proxy settings and change the file permissions have to 0444 just to get the service to start.

Could anyone offer any assistance with this?

Edit: attached copy of freshclam.conf

Post's attachments

freshclam.conf 874 b, 1 downloads since 2020-07-13 

You don't have the permssions to download the attachments of this post.

----

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

2

Re: ClamAV can't parse freshclam.conf after adding proxy settings

macarotto wrote:

Jul 13 16:08:04 redmail01 freshclam[14551]: ERROR: Can't open/parse the config file /etc/clamav/freshclam.conf

Did you try permission 0440 on /etc/clamav/freshclam.conf?

3

Re: ClamAV can't parse freshclam.conf after adding proxy settings

ZhangHuangbin wrote:
macarotto wrote:

Jul 13 16:08:04 redmail01 freshclam[14551]: ERROR: Can't open/parse the config file /etc/clamav/freshclam.conf

Did you try permission 0440 on /etc/clamav/freshclam.conf?

Hi Zhang, no I hadn't tried that yet. I've just tried that and restarted freshclam, but I get the same result as before, "can't open/parse the config file /etc/clamav/freshclam.conf"

I've tried running dpkg-reconfigure for freshclam again, set the permissions to 0440 and done a full restart of the server, but upon checking the service status, it's still showing the same problem.