Make the script aware of running ClamAV daemons to speed up the

detection.
Patch provided by Oscar Santacreu. Thanks, Oscar.

CCMAIL:oscar.santacreu@ua.es

svn path=/branches/KDE/3.5/kdepim/; revision=490090
wilder-work
Andreas Gungl 21 years ago
parent ca9f53b6ea
commit 192378c477
  1. 17
      avscripts/kmail_clamav.sh

@ -33,10 +33,21 @@ if [ $? != 0 ] ; then
fi
export TEMPFILE
cat > $TEMPFILE
if clamscan --stdout --no-summary --mbox $TEMPFILE | grep -q FOUND; then
echo "X-Virus-Flag: yes"
# check for a running daemon
if [ `ps -eo comm|grep clamd` = "clamd" ]; then
chmod a+r $TEMPFILE
CLAMCOMANDO="clamdscan --stdout --no-summary "
else
echo "X-Virus-Flag: no"
CLAMCOMANDO="clamscan --stdout --no-summary --mbox"
fi
# analyze the message
if $CLAMCOMANDO $TEMPFILE | grep -q FOUND; then
echo "X-Virus-Flag: yes"
else
echo "X-Virus-Flag: no"
fi
cat $TEMPFILE
rm $TEMPFILE

Loading…
Cancel
Save