1
docker version 8965 clamav not work
Problem reported by K T - 7/22/2024 at 4:15 AM
Resolved
error log
[2024.07.22]
[2024.07.22] 18:53:18.236 The key {5f4455a6-7e4c-4cd9-8f5c-1f4f8da41f87} was not found in the key ring. For more information go to hxxps://aka.ms/aspnet/dataprotectionwarning
[2024.07.22]    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
[2024.07.22]    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
[2024.07.22]    at SmarterMail.Web.HelperClasses.AuthProtector.Unprotect(Byte[] userData, Byte[] optionalEntropy) in /src/src/SmarterMail/Web/HelperClasses/AuthProtector.cs:line 36
[2024.07.22]    at SmarterMail.Common.POCO.SystemDatabase.db_system_settings.get_rsa_key_unprotected() in /src/src/SmarterMail/Common/POCO/SystemDatabase/db_system_settings.cs:line 255
[2024.07.22]    at MailService.WCF.Services.AuthenticationService.ValidateToken(ServiceToWebLog& loggingDetails, String token) in /src/src/SmarterMail/MailService/WCF/Services/AuthenticationService.cs:line 2453
[2024.07.22]    at MailService.WCF.Services.AuthenticationService.ValidateToken(String token, String& failureReason, String& securityTokenString, ClaimsPrincipal& claimsPrincipal, String& emailAuthenticated) in /src/src/SmarterMail/MailService/WCF/Services/AuthenticationService.cs:line 2432 18:53:27.905
[2024.07.22] Invalid time received from NtpClient.    at MailService.Core.MailServer.PullOfficialTimeFromInternetAndUpdateOffset() in /src/src/SmarterMail/MailService/Core/MailServer.cs:line 3189
could not post with url link. changed https to hxxps in logs.

spam log
[2024.07.22] 18:31:54.097 [43144000 ClamD Checks error: Cannot assign requested address | error
[2024.07.22] 18:55:34.462 [39011000 ClamD Checks error: Cannot assign requested address | error
docker host config: kvm,8cpu/6G Ram/SSD
Docker version 27.0.3, build 7d4bcd8, debian 12 upgraded to latest patch.

and the system is much slower/laggy compared to windows version.
docker stats
CONTAINER ID   NAME          CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O   PIDS
b9be5f3702dd   smartermail   1.31%     441.2MiB / 5.797GiB   7.43%     5.58MB / 20.7MB   0B / 0B     51
thank you.

3 Replies

Reply to Thread
0
Matt Petty Replied
Employee Post
We don't have documentation on it but I was planning on keeping clamav on the outside of smartermail's docker so people can run the clamav container and get the benefits of running clamav next to smartermail. I do not have the steps written out for this yet but it will be along these lines.

1. Make clamav docker container, make sure to use a mount/volume for signatures, and forward the port 3310, give the container a name like "clamav".
2. In SmarterMail, set the clamav provider settings to "external" and set the endpoint to "clamav:3310"

(I'm hoping to have a docker.compose and docker run command example of this later, including an environment variable to set the CLAMAV_IP and CLAMAV_PORT automatically, skipping the need for step 2.)
Stay tuned I'll make sure to update this as I get this information down.
Matt Petty Software Developer SmarterTools Inc. www.smartertools.com
0
K T Replied
thanks Matt, setup external clamav docker works. 

but linux & docker version is much slower than windows version. 
(windows version vm config: 4G Ram/8cpu, disk in ssd nfs share)

tried move linux / docker vm to local ssd disk, no difference. every step is slow.
login after id/pass input: 3-4 seconds
web ui complete: 3-4 seconds
"new mail" ui complete: 6-8 seconds.

0
Matt Petty Replied
Employee Post Marked As Resolution
Our latest release has the CLAMAV_IP and CLAMAV_PORT options. Here is an example compose file I use for testing. (note these are windows local paths, switch them to linux if your running docker on linux)

docker-compose.yml
version: '3.8'

services:
  smartermail:
    image: smartertools/smartermail:latest
    container_name: smartermail
    environment:
      - TZ=America/Phoenix
      - CLAMAV_IP=clamav
    ports:
      - "17017:80"
      - "17018:443"
      - "17018:443/udp"
      - "25:25"
      - "110:110"
      - "143:143"
      - "465:465"
      - "587:587"
      - "993:993"
      - "995:995"
      - "5222:5222"
    volumes:
      - C:\SmarterMailDocker\Data:/app/Data
      - C:\SmarterMailDocker\SystemData:/app/SystemData
    restart: unless-stopped
  clamav:
    image: clamav/clamav:stable
    volumes:
      - C:\SmarterMailDocker\clam_data:/var/lib/clamav
Just copy this file into a folder, open up a terminal in the folder and do 'docker-compose up -d', ezpz.
Connect to your browser with http://localhost:17017, create a domain, send a message to yourself, in the delivery log we print a log message when ClamAV is first detected as working.

Matt Petty Software Developer SmarterTools Inc. www.smartertools.com

Reply to Thread