[Mimedefang] Attachment filtering filename mismatches

jmiller at purifieddata.net jmiller at purifieddata.net
Thu Oct 10 15:45:01 EDT 2002


On Thu, 10 Oct 2002, Stephane Lentz wrote:

> On Thu, Oct 10, 2002 at 01:51:34PM -0400, David T Hollis wrote:
> > We recently introduced filtering off bad attachment formats (small
> > subset of the stock ones in the example filter) and have come across a
> > small problem on the name matching.  People are sending VCards (.vcf)
> > which are not blocked, but the filter is matching in cases where the
> > filename contains .com (as in joedomain.com.html, Joe User
> > (juser at domain.com).vcf).  Any workaround for this?
> >
>
> David,
> perl code is your friend :-)
> MIMEDefang is very clean and clear (thanks David).
>
> Look at your mimedefang-filter filter, especially filter_bad_filename
> You will have to
> -  add  return 0  if  (....) ;  in filter_bad_filename for special cases you want to allow
>  or
> - change  the $re reg-exp
>
> SL/
> ---
> Stephane Lentz / Alcanet International - Internet Services
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>

You might want to move the "com" out of the default bad extension list,
then add a line like:
return 1 if re_match($entity, '\.com$');

That'll match only when the filename ends in ".com", instead of just
matching when it find ".com" anywhere in the filename.
You could also just add the "$" to the end of the existing re_match
if you only want to reject when the filename ends with one of those.

--
Josh I.




More information about the MIMEDefang mailing list