[Mimedefang] More Help with filter - Almost there

Paul Whittney pwhittney at net.bacconsulting.com
Mon Apr 5 13:42:13 EDT 2004


Mark,

On Mon, Apr 05, 2004 at 10:02:00AM -0400, Mark Penkower wrote:
> The enclosed filter almost works - except it doesn't just bounce the
> extensions that I have banned, it blocks all extensions.  I am sure that
> I am just missing something simple here.

I think someone already pointed out the || error below, but there
could be another issue.

sub filter_bad_filename ($) {
... snip ...
    #$re = '\.' . $bad_exts . '\.*$';
	return re_match($entity, $re);
}

You need the variable $re to be set with
	$re = '\.' . $bad_exts . '\.*$';
otherwise its null, and I think the return becomes: 1

(thats me having a quick look at re_match inside mimedefang.pl,
should there be a check in that code for a null argument? but
then there would a risk of slowdown? return 0 for a null??
just thinking out loud... You could argue that to run mimedefang
you need to know perl very well, and thats no insult to you Mark)

I think you asked about the leading .'s too, just have:
$re = '\.' . $bad_exts . '$';

-Paul Whittney



More information about the MIMEDefang mailing list