[Mimedefang] Next generation mimedefang-filter

Paul Whittney pwhittney at net.arrivetech.com
Thu May 12 07:43:29 EDT 2005


Nik,

It's something that's crossed my mind, but I think the way MIMEDefang
is a part of the CanIt system, I doubt a major change of filter config
is going to be high on David's list.

However, I hit the same issue, multiple config files, with slightly
different functionality, or a complete lack of certain functions. I
actually had more trouble with revision control of the ziptest parts,
the actual "defang notice", boilerplate additions, and the changes to 
the bad attachment files between a number of systems.

So, I split up the mimedefang config file into a parts directory:
defang_warning.m4
filter.m4
filter_begin.m4
filter_cleanup.m4
filter_end.m4
filter_initialize.m4
filter_multipart.m4
filter_recipient.m4
filter_relay.m4
filter_sender.m4
footer.m4
header.m4
subroutines.m4

and made a Makefile (this is not very pretty... but hell, it works for me ;-)
#--- Makefile start ---
FILES= $(wildcard filter*.m4) defang_warning.m4

../mimedefang-filter: header.m4 subroutines.m4 ${FILES} footer.m4
        cat $^ > $@
#--- Makefile end ---

this makes sure the things at the top stay there, and the 1; stays 
at the bottom ;-)

Then the whole directory is placed on our local CVS server (via ssh, 
of course), under the name of the system. If I break a config, I can 
see what changed, and revert back to the last good commit. I can see
in future that other admins will commit changes too.

Now a make will only occur on dependency changes.

Yes, they are .m4 files. I'm thinking of passing them through m4 for
specific things, but not quite yet. The next step is to have a common
subroutines file for all systems, rather than a per machine file.

This also helps me out when I need to check the filter sub, and don't
want to go through the whole file.

-Paul

On Thu, May 12, 2005 at 11:36:22AM +0100, Nik Clayton wrote:
> Hi all,
> 
> I'm thinking out loud here.
> 
> I've got a number of different systems running MimeDefang, grouped in to 
> 'classes'.  Each system in the same class has identical functionality, 
> and some, but not all, functionality can be shared by different classes.
> 
> At the moment each class has a custom mimedefang-filter file.  There's a 
> lot of duplication between files, which is bad, and it makes it tricky 
> to verify that the same functionality is implemented in the same way.
> 
> It's also a pain to test.
> 

<snip>

> Thoughts?  Would anyone use this?  David, would you be happy to see 
> MimeDefang go in this sort of direction?
> 
> N
-- 
Paul Whittney                                  ArriveTech, Inc.
Network Specialist / Systems Engineer         / |670 West 36th Street,
PWhittney [at] arrivetech.com (Main)         /--|Erie, PA, 16508, USA
PWhittney [at] net.arrivetech.com (Aux)     /   |www.arrivetech.com



More information about the MIMEDefang mailing list