On Tue, 3 Jan 2006, Joseph Brennan wrote:


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

It must be because of the ".com " in the name.

I just took a look at man mimedefang-filter, you could try this:

      action_defang($entity, $name, $fname, $type)
              Accept  the part, but change its name to $name, its
              suggested filename to $fname and its MIME  type  to
              $type.   If  $name  or  $fname are "", then mimedeĀ­
              fang.pl generates generic names.  Do not  use  this
              action in filter_multipart.

e.g. when you call filter_bad_filename() and it triggers a bad file, you could try to peek into the filename and rename it into, say,

$filename =~ s/[\s\r\n\;\[\]\(\)\=\+\:_]+/_/gs;

Maybe this is a good thing to do for all attachements, however, action_defang() will append a "warning" noting the change.

Bye,

--
Steffen Kaiser
_______________________________________________
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