[Mimedefang] Re: modular filter (was DNS Lookups in MD)

Paul Murphy Paul.Murphy at argentadiscovery.com
Fri May 11 17:43:12 EDT 2007


>BTW, several years ago, someone helping me with RelayRegistry showed me
how 
>to start making MD "mini" modules.  I didn't understand what they
meant then 
>but now I see the error of my ways.  However, despite my searching, I
can't 
>find the info.  I'm looking to do something like put all the reverse
DNS 
>info in a separate file and use a C-esque #INCLUDE.

In filter_initialize(), do the following:

require "local_module.pl";


In local_module.pl, define your subroutines as normal, and then call
them from wherever in your filter you need them - since the "require"
statement brings them in before anything else in your filter runs, they
will always be in scope.

I use this for greylisting, broadband checks, database connection
setup, and several other checks, which means my filter is kept lean and
readable.  I've toyed with making the whole filter into just the globals
and then a filter_initialize() which has:

require "filter_sender.pl";
require "filter_recipient.pl";
require "filter_relay.pl";
require "filter.pl";
require "filter_begin.pl";
require "filter_end.pl";
require "filter_multipart.pl"

In theory it should work, but I don't have a spare system to test this
on...

Best Wishes,

Paul.


-- 

-------------------------------------------------------
Paul Murphy
Head of I.T.
Argenta Discovery
Tel. 01279 645 554
Fax. 01279 645 646


_______________________________________________________________________
Argenta Discovery Ltd, 8-9 Spire Green Centre, Harlow, Essex, CM19 5TR
Registered in England No. 3671653
_______________________________________________________________________ 




More information about the MIMEDefang mailing list