VERBOSE=off LOGFILE=/var/log/virus.log SUBJECT=`formail -xSubject:` ARRIVED=`formail -xDate:` TOEMAIL=`formail -xTo:` SENDMAIL=/usr/sbin/sendmail ATTACH=`grep -i -E "\.(vbs|wsf|vbe|wsh|hta|scr|pif|com|exe|shs|bat|bas|scr|eml|dll)"` #looping sanity ## At the first recipe use for filtering duplicate Message-ID: :0 Wh: msgid.lock |formail -D 8192 msgid.cache ## First off, lets get some safe headers happening, dont filter stuff we've already looked at :0 H * !^X-Loop: Attachment scanner { :0 f ## Add our header, yup we've read it alright |formail -A"X-Loop: Attachment scanner" # Things to look for in the body :0 B * name=.*\.(vbs|wsf|vbe|wsh|hta|scr|pif|com|exe|shs|bat|bas|scr|eml|dll) { :0 /home/antivirus/virus.save } }