> Twice today I've had to restart my mail services because ClamAV was
> unable to allocate more memory.  I know this is not the ClamAV list,
> but I was wondering if anyone knew about configuration tweaks I could do
> within the toaster itself to make it more efficient.  My next steps,
> of course, are to mail the SA and ClamAV lists to find out what's going
> on.

I improved my toaster by rejecting virus at smtp level instead of deleting
them at delivery time. I use Clamav+qmail-qfilter with this script:

---
#!/usr/bin/perl

$MKTEMP='/bin/mktemp' ;
$CLAMSCAN='/usr/local/bin/clamdscan' ;
@file = <> ;
$TMPFILE=`$MKTEMP /tmp/clamtemp.XXXXXX` ;
chomp $TMPFILE ;
open  CLAM, "|$CLAMSCAN --stdout  - > $TMPFILE" ;
print CLAM @file ;
close CLAM ;
open TMP1, "<$TMPFILE" ;
while ( <TMP1> ) {
        if ( $_ =~ /FOUND/ ) {
                close TMP ;
                unlink $TMPFILE ;
                exit(33);
        }
}
close TMP ;
unlink $TMPFILE ;
print @file ;
---
About exit code 33 instead of 31, I changed qmail.c to reject with a
specific message: "554 rejected message because it contains a virus"

About SA, each account has anti-spam turned off by default and users can
turn it on if needed.

Regards,

Julio

Reply via email to