--On Tuesday, January 3, 2006 21:23 -0500 "Kevin A. McGrail" <[EMAIL PROTECTED]> wrote:

I just tested by renaming a gif to .com.txt and sending it to myself and
it worked fine.  Can you post your filter_bad_filename?

----- Original Message -----
From: "Joseph Brennan" <[EMAIL PROTECTED]>

An attachment with this name was snagged as an executable by the
example filter_bad_filename routine:

WSJ.com - Cutting Hedge_ Law Firm Grows With Funds.pdf



The space after ".com" might be the significant factor.  Here 'tis:


# This procedure returns true for entities with bad filenames.
sub filter_bad_filename ($) {
   my($entity) = @_;
   my($bad_exts, $re);

   # Bad extensions
# List updated 8/27/03 to conform to MS Office 2003 list at microsoft.com
   # except inf removed (used for OCLC library-related data mailings)
$bad_exts = '(ade|adp|app|bas|bat|chm|cmd|com|cpl|crt|csh|dll|exe|fxp|hlp|h\
ta|ini|ins|isp|jse?|ksh|lib|lnk|mda|mdb|mde|mdt|mdw|msc|msi|msp|mst|ocx|ops|pcd\
|pif|prg|reg|scr|sct|shb|shs|sys|upx|vb|vbe|vbs|wsc|wsf|wsh|xsl|\{[^\}]+\})';

   # Do not allow:
   # - CLSIDs  {foobarbaz}
   # - bad extensions (possibly with trailing dots) at end
   # added ] and / to the list, to stop catching urls for dot-coms
   $re = '\.' . $bad_exts . '\.*$';
   return re_match($entity, $re);
}


Joseph Brennan      [EMAIL PROTECTED]
Columbia University in the City of New York





_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to