[Mimedefang] mimedefang filter > filter file names < ??

Cormack, Ken kcormack at acs.roadway.com
Tue Aug 5 16:59:01 EDT 2003


My customer just happened to ask about this very thing this morning, as
well.

I kicked around the following idea with him... (snippet of that dialog,
below)

========== :: start of snippet ::
In mimedefang-filter, immediately after the list of extensions to reject,
you'll see where the attachment name is evaluated against the list of bad
extensions...

    # Do not allow:
    # - curlies
    # - bad extensions (possibly with trailing dots) at end or
    #   followed by non-alphanum
    $re = '\.' . $bad_exts . '\.*([^-A-Za-z0-9_.,]|$)';
    return re_match($entity, $re);

Since it's a regular expression, it should be possible to do something like
this.  In addition to "#bad_exts =", we could define:

    "$bad_filenames = '(message.zip|badname2.foo)'  ...etc

Then, change the comparison to this:

    $re = '\.' . $bad_exts . $bad_filenames . '\.*([^-A-Za-z0-9_.,]|$)';
    return re_match($entity, $re);

A few lines above that, this would have to change, too...
    my($bad_exts, $re);

You know perl better than I, so does it look good to you?
=========== :: end of snippet ::

He and I have both been busy today, so the discussion hasnt yet gone any
further than this since this morning, but I dont see any great difficulty
(unless my perl syntax is wrong, in the expanded regex test - I'm not strong
in perl.)

Ken

-----Original Message-----
From: troy at lebouef.com [mailto:troy at lebouef.com]
Sent: Tuesday, August 05, 2003 4:15 PM
To: mimedefang at lists.roaringpenguin.com
Subject: [Mimedefang] mimedefang filter > filter file names < ??


Anyone know how to modify fimedefang-filter in order to filter names of
files and not just extentions ?

And if so , an example of the mod would be great ... Thanks in advance.

Troy

_______________________________________________
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang



More information about the MIMEDefang mailing list