I've been troubleshooting exim paniclog messages from my DA 1.50.1 installation pertaining to clamd problems:
All the clam bits are running:
I enabled logging for clamd and freshclam, and I'm now able to see that the processes don't throw any errors when they start:
ClamAV was built using CB 2.0 and exim.conf seems to have ClamAV based stuff in there; I'm presuming it's complete; I haven't touched the config except to add local_part_suffix for virtual_aliases_nostar:, virtual_user: and virtual_aliases:, all of which works fine otherwise:
/etc/exim.clamav.load.conf
/etc/exim.clamav.conf
I sent myself a EICAR test message from: http://www.aleph-tec.com/eicar/index.php, but ClamAV didn't even seem to fire.
Is EICAR not a reasonable way to test ClamAV? Or is something perhaps broken/missing in my config?
I'm not quite sure where to look, so if anyone has any pointers, I'd be grateful.
Thanks in advance!
Code:
2016-06-19 03:57:19 1bEXbQ-0004Fa-Ve malware acl condition: clamd [127.0.0.1]:3310 : unable to read from socket (Connection timed out)
All the clam bits are running:
Code:
# ps xa|grep -i clam
11849 ? Ssl 0:08 /usr/local/sbin/clamd --foreground=yes
11862 ? Ss 0:00 /usr/local/bin/freshclam -d
20679 pts/1 S+ 0:00 grep -i clam
I enabled logging for clamd and freshclam, and I'm now able to see that the processes don't throw any errors when they start:
Code:
# service clamd restart ; service freshclam restart && tail -n 100 -f /var/log/mail.log | grep clam
Jun 19 09:28:38 hosting1 clamd[11821]: Waiting for all threads to finish
Jun 19 09:28:38 hosting1 clamd[11821]: Shutting down the main socket.
Jun 19 09:28:38 hosting1 clamd[11821]: Pid file removed.
Jun 19 09:28:38 hosting1 clamd[11821]: --- Stopped at Sun Jun 19 09:28:38 2016
Jun 19 09:28:38 hosting1 clamd[11821]: Closing the main socket.
Jun 19 09:28:38 hosting1 freshclam[11834]: Update process terminated
Jun 19 09:28:38 hosting1 clamd[11849]: Received 0 file descriptor(s) from systemd.
Jun 19 09:28:38 hosting1 clamd[11849]: clamd daemon 0.99.2 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Jun 19 09:28:38 hosting1 clamd[11849]: Log file size limited to 1048576 bytes.
Jun 19 09:28:38 hosting1 clamd[11849]: Reading databases from /usr/local/share/clamav
Jun 19 09:28:38 hosting1 clamd[11849]: Not loading PUA signatures.
Jun 19 09:28:38 hosting1 clamd[11849]: Bytecode: Security mode set to "TrustSigned".
Jun 19 09:28:38 hosting1 freshclam[11860]: Current working dir is /usr/local/share/clamav
Jun 19 09:28:38 hosting1 freshclam[11862]: freshclam daemon 0.99.2 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Jun 19 09:28:38 hosting1 freshclam[11862]: Max retries == 3
Jun 19 09:28:38 hosting1 freshclam[11862]: ClamAV update process started at Sun Jun 19 09:28:38 2016
Jun 19 09:28:38 hosting1 freshclam[11862]: Using IPv6 aware code
Jun 19 09:28:38 hosting1 freshclam[11862]: Querying current.cvd.clamav.net
Jun 19 09:28:38 hosting1 freshclam[11862]: TTL: 1730
Jun 19 09:28:38 hosting1 freshclam[11862]: Software version from DNS: 0.99.2
Jun 19 09:28:38 hosting1 freshclam[11862]: main.cvd version from DNS: 57
Jun 19 09:28:38 hosting1 freshclam[11862]: main.cvd is up to date (version: 57, sigs: 4218790, f-level: 60, builder: amishhammer)
Jun 19 09:28:38 hosting1 freshclam[11862]: daily.cvd version from DNS: 21752
Jun 19 09:28:38 hosting1 freshclam[11862]: daily.cld is up to date (version: 21752, sigs: 312364, f-level: 63, builder: neo)
Jun 19 09:28:38 hosting1 freshclam[11862]: bytecode.cvd version from DNS: 281
Jun 19 09:28:38 hosting1 freshclam[11862]: bytecode.cld is up to date (version: 281, sigs: 51, f-level: 63, builder: neo)
Jun 19 09:28:38 hosting1 freshclam[11862]: --------------------------------------
Jun 19 09:28:45 hosting1 clamd[11849]: Loaded 4525812 signatures.
Jun 19 09:28:47 hosting1 clamd[11849]: TCP: Bound to [127.0.0.1]:3310
Jun 19 09:28:47 hosting1 clamd[11849]: TCP: Setting connection queue length to 200
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: Global size limit set to 104857600 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: File size limit set to 26214400 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: Recursion level limit set to 16.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: Files limit set to 10000.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: Core-dump limit is 0.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxEmbeddedPE limit set to 10485760 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxHTMLNormalize limit set to 10485760 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxHTMLNoTags limit set to 2097152 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxScriptNormalize limit set to 5242880 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxZipTypeRcg limit set to 1048576 bytes.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxPartitions limit set to 50.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxIconsPE limit set to 100.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: MaxRecHWP3 limit set to 16.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: PCREMatchLimit limit set to 10000.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: PCRERecMatchLimit limit set to 5000.
Jun 19 09:28:47 hosting1 clamd[11849]: Limits: PCREMaxFileSize limit set to 26214400.
Jun 19 09:28:47 hosting1 clamd[11849]: Archive support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: Algorithmic detection enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: Portable Executable support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: ELF support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: Mail files support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: OLE2 support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: PDF support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: SWF support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: HTML support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: XMLDOCS support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: HWP3 support enabled.
Jun 19 09:28:47 hosting1 clamd[11849]: Self checking every 600 seconds.
Jun 19 09:28:47 hosting1 clamd[11849]: Listening daemon: PID: 11849
Jun 19 09:28:47 hosting1 clamd[11849]: MaxQueue set to: 100
ClamAV was built using CB 2.0 and exim.conf seems to have ClamAV based stuff in there; I'm presuming it's complete; I haven't touched the config except to add local_part_suffix for virtual_aliases_nostar:, virtual_user: and virtual_aliases:, all of which works fine otherwise:
Code:
# cat /etc/exim.conf | grep -A5 -B5 -i clam
# SpamBlockerTechnology* powered exim.conf, Version 4.4.2
# Dec 5, 2015
# Exim configuration file for DirectAdmin
# Requires exim.pl as distributed by DirectAdmin here:
# http://files.directadmin.com/services/exim.pl version 21 or higher
# ClamAV optional
# SpamAssassin optional
# Dovecot/IMAP Mandatory
# *SpamBlockerTechnology is a Trademark of NoBaloney Internet Services:
# http://www.nobaloney.net
#
--
#EDIT#1:
# primary_hostname =
smtp_active_hostname = ${if exists{/etc/virtual/helo_data}{${lookup{$interface_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
#EDIT#2-CLAMAV:
# av_scanner = clamd:/var/run/clamav/clamd
.include_if_exists /etc/exim.clamav.load.conf
#Block Cracking variables
.include_if_exists /etc/exim.blockcracking/variables.conf
#Easy Spam Figher variables
--
######################################
# ACL CHECK MESSAGE
######################################
# ACL that is used after the DATA command (ClamAV)
acl_check_message:
accept condition = ${if eq{$acl_m_is_whitelisted}{1}{1}{0}}
.include_if_exists /etc/exim.easy_spam_fighter/check_message.conf
#EDIT#46:
.include_if_exists /etc/exim.clamav.conf
## accept without checking if in skip_av_domains
# accept condition =${if and {{def:acl_m0}{def:acl_m0}} {true}{false}}
## deny if email contains malformed MIME header
# deny message = CLAM_MALFORMED_MIME
# demime = *
# condition = ${if >{$demime_errorlevel}{2}{1}{0}}
## deny if email containing virus or other harmful content
# deny message = CLAM_HAS_VIRUS
# demime = *
# malware = *
## deny if email contains an attachment of type we don't accept.
# deny message = CLAM_BAD_ATTACHMENT
# demime = bat:com:pif:prf:scr:vbs:html
## Accept but put warning into headers if message over 1000k
# warn message = CLAM_SKIPPED
# condition = ${if >={$message_size}{1000k} {1}{0}}
# warn message = CLAM_CLEAN
## The end of the acl_check_message acl (ClamAV)
## Do NOT comment out the line below or all messages will be denied.
accept
##################################################################################
/etc/exim.clamav.load.conf
Code:
# cat /etc/exim.clamav.load.conf
#1.0
av_scanner = clamd:127.0.0.1 3310
/etc/exim.clamav.conf
Code:
# cat /etc/exim.clamav.conf
#1.2
deny
message = This message contains a virus or other harmful content ($malware_name)
malware = */defer_ok/tmo=10s
log_message = Message from $sender_host_address denied - virus of harmful content ($malware_name)
warn
message = X-Antivirus-Scanner: Clean mail though you should still use an Antivirus
#
I sent myself a EICAR test message from: http://www.aleph-tec.com/eicar/index.php, but ClamAV didn't even seem to fire.
Code:
# grep -i eicar /var/log/exim/mainlog
2016-06-19 09:05:56 1bEcQG-0002cH-KK <= [email protected] H=batch.outbound.your-site.com [205.233.73.32] P=esmtps X=TLSv1.2:AECDH-AES256-SHA:256 CV=no S=2661 [email protected] T="EICAR anti-virus test file:" from <[email protected]> for jason-aleph-tech.com - at - lixfeld.ca
2016-06-19 09:05:56 1bEcQG-0002cG-KK <= [email protected] H=batch.outbound.your-site.com [205.233.73.32] P=esmtps X=TLSv1.2:AECDH-AES256-SHA:256 CV=no S=2439 [email protected] T="EICAR anti-virus test file:" from <[email protected]> for jason-aleph-tech.com - at - lixfeld.ca
2016-06-19 09:05:56 1bEcQG-0002cI-KK <= [email protected] H=batch.outbound.your-site.com [205.233.73.32] P=esmtps X=TLSv1.2:AECDH-AES256-SHA:256 CV=no S=4652 [email protected] T="EICAR anti-virus test file:" from <[email protected]> for jason-aleph-tech.com - at - lixfeld.ca
2016-06-19 09:05:59 1bEcQG-0002cR-O2 <= [email protected] U=mail P=spam-scanned S=2899 [email protected] T="EICAR anti-virus test file:" from <[email protected]> for jason-aleph-tech.com - at - lixfeld.ca
2016-06-19 09:05:59 1bEcQG-0002cR-O2 => jason <jason-aleph-tech.com - at - lixfeld.ca> F=<[email protected]> R=virtual_user T=dovecot_lmtp_udp S=3100 C="250 2.0.0 <jason - at - lixfeld.ca> 2u1cFbeYZlc8JgAARPuFGw Saved"
2016-06-19 09:05:59 1bEcQG-0002cG-KK => jason-aleph-tech.com <jason-aleph-tech.com - at - lixfeld.ca> F=<[email protected]> R=spamcheck_director T=spamcheck S=2770
2016-06-19 09:06:00 1bEcQG-0002cf-Pp <= [email protected] U=mail P=spam-scanned S=5159 [email protected] T="EICAR anti-virus test file:" from <[email protected]> for jason-aleph-tech.com - at - lixfeld.ca
2016-06-19 09:06:00 1bEcQG-0002cf-Pp => jason <jason-aleph-tech.com - at - lixfeld.ca> F=<[email protected]> R=virtual_user T=dovecot_lmtp_udp S=5399 C="250 2.0.0 <jason - at - lixfeld.ca> tJKCA7iYZlduJwAARPuFGw Saved"
2016-06-19 09:06:00 1bEcQG-0002cI-KK => jason-aleph-tech.com <jason-aleph-tech.com - at - lixfeld.ca> F=<[email protected]> R=spamcheck_director T=spamcheck S=5030
2016-06-19 09:06:00 1bEcQG-0002cV-O5 <= [email protected] U=mail P=spam-scanned S=3121 [email protected] T="EICAR anti-virus test file:" from <[email protected]> for jason-aleph-tech.com - at - lixfeld.ca
2016-06-19 09:06:00 1bEcQG-0002cV-O5 => jason <jason-aleph-tech.com - at - lixfeld.ca> F=<[email protected]> R=virtual_user T=dovecot_lmtp_udp S=3328 C="250 2.0.0 <jason - at - lixfeld.ca> 9mHpKbiYZld2JwAARPuFGw Saved"
2016-06-19 09:06:00 1bEcQG-0002cH-KK => jason-aleph-tech.com <jason-aleph-tech.com - at - lixfeld.ca> F=<[email protected]> R=spamcheck_director T=spamcheck S=2992
Is EICAR not a reasonable way to test ClamAV? Or is something perhaps broken/missing in my config?
I'm not quite sure where to look, so if anyone has any pointers, I'd be grateful.
Thanks in advance!
Last edited: