Chris Thielen said:
> Charles Gregory said:
>> On Mon, 9 Feb 2004, Jon wrote:
>>> ClamAV is free and also does a good job of catching MyDoom.
>>
>> Seeing how spamc is so easily added to procmailrc to do its stuff,
>> is there any equivalent procmail based setup for clamav? FAQ's and stuff
>> on the clamav page don't cover this.....
>>
> Here's mine:
>
> :0fw: /home/sone/bin/clamstream.lock
> | /home/sone/bin/clamstream
>
> :0
> * ^X-Virus-Found:.*YES
> Maildir/.Junk.Virus/
>

Oh, hey. I suppose the clamstream script would be helpful as well?

#!/bin/sh

tempfile=`tempfile`
cat - >> $tempfile

mkdir ${tempfile}-check
cd ${tempfile}-check

# cat $tempfile | reformime -xpart-
cat $tempfile | base64dec > file
clamscan --threads=1 --disable-summary --quiet
virus=$?

if [ $virus -eq 1 ]; then
  cat $tempfile | formail -a "X-Virus-Found: YES"
else
  cat $tempfile
fi

rm -rf $tempfile ${tempfile}-*


Reply via email to