#!/bin/ksh # Sortie differee de quarantaine des messages avec attachements suspect # Version 1.0 du 23/11/04 par Christian Pélissier export PATH=/usr/bin:/usr/local/bin # Parametres JCMCONFIG=/etc/mail/jchkmail/j-chkmail.cf APACHEDIR=/usr/local/apache2/mailstats/jchkmail JKEEP=2 AKEEP=30 SPOOLDIR=$( grep '^SPOOLDIR' $JCMCONFIG | awk '{print $2}' ) if [[ ! -d $APACHEDIR ]] then mkdir $APACHEDIR chmod 755 $APACHEDIR fi if cd $SPOOLDIR then find . -type f -mtime +$JKEEP -exec ls {} \; | while read filename do filename=${filename#./} if clamscan --no-summary --detect-broken $filename 2> $APACHEDIR/$filename.rfc822 then # Pas de virus mv -f $filename $APACHEDIR/$filename.rfc822 else # Virus détecté rm $filename fi chmod 644 $APACHEDIR/$filename.rfc822 done else print -- "${0##*/} : $SPOOLDIR directory no found" exit 1 fi if cd $APACHEDIR then touch index.html find $APACHEDIR -type f -mtime -AKEEP -exec rm {} \; fi