Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 8th January 2013, 17:17
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 395
Thanks: 30
Thanked 58 Times in 50 Posts
Default

Well, here we are over a year later, and I'm trying to disable ClamAV on a given ISPConfig 3 server, while leaving Amavis intact.

I tried following the steps that I had posted last year only to find that these two lines are already commented:

Code:
#@bypass_virus_checks_maps = (
#   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
I uninstalled ClamAV and still the mail log is filling-up with:

Code:
Jan  8 07:11:03 example amavis[7945]: (07945-14) (!)ClamAV-clamd: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: 2, retrying (2)
Jan  8 07:11:09 example amavis[7945]: (07945-14) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 117) line 373.\n
Jan  8 07:11:09 example amavis[7945]: (07945-14) (!!)WARN: all primary virus scanners failed, considering backups
Jan  8 07:11:09 example amavis[7945]: (07945-14) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED
Jan  8 07:11:09 example amavis[7945]: (07945-14) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20130108T071101-07945
Jan  8 07:11:09 example postfix/smtp[1877]: E0F2E6A3009F: to=<user@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=7.1, delays=0.06/0/0/7.1, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=07945-14, virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED (in reply to end of DATA command))
How can I get rid of this $%&*#@! (ClamAV) once and for all?
Reply With Quote
Sponsored Links
  #12  
Old 8th January 2013, 17:25
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

To disable clamav, comment out the clamav sections for clamd and clamav in the amavisd configuration, e.g. on debian Linux the file is /etc/amavis/conf.d/15-av_scanners

add a # in front of these lines:

...
### http://www.clamav.net/
['ClamAV-clamd',
\&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
qr/\bOK$/, qr/\bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
....


and

....
### http://www.clamav.net/ - backs up clamd or Mail::ClamAV
['ClamAV-clamscan', 'clamscan',
"--stdout --disable-summary -r --tempdir=$TEMPBASE {}",
[0], qr/:.*\sFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
.....

then restart amavisd.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #13  
Old 8th January 2013, 17:46
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 395
Thanks: 30
Thanked 58 Times in 50 Posts
Default

Thank you for the fast response, Till. I really appreciate it.

On the first page of this thread, I describe how I tried exactly what you suggested when I ran into this on a different server last year. It didn't work for me last year, and it didn't work this time.

When I comment-out the lines you suggested, the message changes slightly from being ClamAV-specific to being more generic:

Code:
Jan  8 07:37:07 example amavis[13387]: (13387-01) (!!)WARN: all primary virus scanners failed, considering backups
Jan  8 07:37:07 example amavis[13387]: (13387-01) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: NO VIRUS SCANNERS AVAILABLE
Jan  8 07:37:07 example amavis[13387]: (13387-01) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20130108T073707-13387
Jan  8 07:37:07 example postfix/smtp[13346]: 37B276A3001A: to=<user@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.1, delays=0.01/0/0.01/0.08, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=13387-01, virus_scan FAILED: AV: NO VIRUS SCANNERS AVAILABLE (in reply to end of DATA command))
So, now Amavis is saying that no virus scanner is available (as opposed to saying that ClamAV is not available). Again, I don't understand why Amavis cares if no virus scanner is available when I have intentionally disabled all virus scanning (at least, that was my intention).

Furthermore, shouldn't one be able to disable all virus scanning simply by adjusting those two lines in /etc/amavis/conf.d/50-user? Isn't that the point of @bypass_virus_checks_maps? It seems much less ideal to comment-out the actual ClamAV code in 15-av_scanners.

On that note, it is not clear whether @bypass_virus_checks_maps should be commented or un-commented to disable all virus scanning. Of course, this is again something that I discussed in this thread last year, and I thought I had made this determination, but now I am not so sure.

Thanks again for any help; this is frustrating.
Reply With Quote
  #14  
Old 8th January 2013, 18:43
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

Try this on Debian or Ubuntu:

Add a new file /etc/amavis/conf.d/90-custom

with the following content:

Code:
use strict;

@bypass_virus_checks_maps  = (1);

#------------ Do not modify anything below this line -------------
1;  # insure a defined return
and restart amavisd.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following 2 Users Say Thank You to till For This Useful Post:
cbj4074 (8th January 2013), djbill (22nd February 2013)
  #15  
Old 8th January 2013, 20:09
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 395
Thanks: 30
Thanked 58 Times in 50 Posts
Default

You, sir, are a true hero! That worked!

Why does this solution work when commenting the lines

Code:
#@bypass_virus_checks_maps = (
#   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
in 50-user does not? Any idea?
Reply With Quote
  #16  
Old 8th January 2013, 20:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
 
Default

The lines in 50-user exist to override the amavisd defaults to allow disabling of the antivirus scanning in the policys, so if you comment that out, the defaults get applied again.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forbidden 403; Samba access; config of maildeamon fawkes Installation/Configuration 4 14th January 2010 19:16
disable SpamAssassin and ClamAV and amavis darkhoros Tips/Tricks/Mods 7 19th December 2009 13:15
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06
ISP Config not working in mandriva 2008 bigdavid889 Server Operation 8 28th February 2008 21:05
Postfix + Amavis + SpamAssassin + ClamAV michele HOWTO-Related Questions 4 1st July 2006 15:36


All times are GMT +2. The time now is 07:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.