#!/bin/sh # # qmail -- checkfile # Author: Erwin Hoffmann # Date: 07 March 2001 Version: 0.1 # This is release under the GNU/GPL. # This is a very crude program. Use at your own risk. # This will bounce incoming email with specified Attachment Filenames # # I use this in a user's .qmail file # by adding the line # |/usr/local/bin/checkfile # before the ./Maildir/ # # Make sure to chmod 555 /usr/local/bin/checkfile # so that qmail users can execute it. # Start program here. printmsg () { echo "The reason your email was rejected is you sent an attachment that can cause problems." echo "Sorry, the attachment you sent is in violation of our company's policy because it can cause problems like virus, or increase traffic load, or delete file(s) and/or among others." echo "Please disable HTML formatting when sending email because Visual Basic Script Worms/Virus normally exploits this." echo "--- Attachment $ATTFILE was rejected" } # # Check for NOT allowed attachment. # Here you can include more filenames you want. # checkfile () { case $ATTFILE in NAKEDWIFE.EXE ) printmsg $ATTFILE exit 100;; *) ;; esac } ## This allows filtering of indivdual Attachements identfied by the mame. ## Specifiy the attachement filename in UPPERCASE ATTACHFILE=`grep "name=" - | cut -d'"' -f2 | tr '[a-z]' '[A-Z]'` for ATTFILE in $ATTACHFILE do checkfile $ATTFILE done exit 0