[Mimedefang] Dropping Files

Ole Holm Nielsen Ole.H.Nielsen at fysik.dtu.dk
Wed Oct 29 07:24:22 EST 2003


We drop bad extensions using the method given in this posting:
http://lists.roaringpenguin.com/pipermail/mimedefang/2003-September/007768.html
Actually, we do it slightly differently with this code just
before the "if ($FoundVirus) {" line in "sub filter ($$$$)":

     if ($ext =~ /(pif|scr)/) {
         md_graphdefang_log("Dropping message containing attachment $fname from 
$RelayAddr");
         return action_discard();
     }

We're really pleased with this filter !

Benjamin Schmaus wrote:
 > I had this snippet of code in my filter sub routine.  And
 > while it matches on the 3 attachments listed in $drop_exts,
 > it also drops other files, like doc and xls.  Can anyone
 > explain why this would be happening?
 >
 >
 > $drop_exts = '(pif|scr|bat)';
 > if (re_match($entity, $drop_exts)) {
 >      md_graphdefang_log("VIRUS: dropping file $fname from
 > $RelayAddr");
 >      return action_discard();
 > }


Ole Holm Nielsen
Dept. of Physics, Technical University of Denmark



More information about the MIMEDefang mailing list