[Mimedefang] custom function - stripping attachments based on headers

David F. Skoll dfs at roaringpenguin.com
Tue Apr 30 12:18:05 EDT 2002


On 30 Apr 2002 10:42:13 -0500 Terry Davis <tdavis at approbation.org> wrote:

> I want it to work like such:
> If mimedefang thinks it is a virus or spam, then do what it needs to
> with it, if it makes it through those checks then I want it to go
> through my little program if the headers match up to what I want...I
> think I know how to go about all that except where to place this
> function....

You can define the function anywhere in your filter file.  The filter
file is just a chunk of Perl code which gets added to the main body
of mimedefang.pl.  So you can do this in the filter file.

sub my_function {
        my($arg1, $arg2) = @_;
        # whatever
}

sub filter {
        # blah blah blah...

        if (my_function($entity, "foo")) {
                action_quarantine($entity, "my_function said so!");
        }
        # blah blah blah...
}

You can even define external Perl files which are brought in with
require.  You can build up a library of Perl filtering routines if
you're ambitious. :-)

--
David.




More information about the MIMEDefang mailing list