Why Perl, not config file? (was Re: [Mimedefang] newbie question: are all the rules hardcoded?)

David F. Skoll dfs at roaringpenguin.com
Mon Mar 10 16:22:07 EST 2003


On Mon, 10 Mar 2003, Eric Wood wrote:

> Agreed, the parsing of a central config file would add complexity to MD's
> general action() functions.  However, I do think in the long run it would
> save much time in getting a system up and running through a config file than
> through inline code changes.  That's just how samba and most everthing else
> works that I am used to.

I know.  That's why I didn't do it that way.

Seriously, I could not predict how MIMEDefang would be used.  Experience
has taught me that a real language is much more powerful than a configuration
file, and easier on the developer -- why waste time writing a (probably
buggy, definitely idiosyncratic) config-file parser when Perl includes
a perfectly good parser of its own?  You should read John Ousterhout's
thoughts on this subject: http://www.sun.com/960710/cover/ousterhout.html

    "I got the idea for Tcl after building several interactive
     applications for integrated circuit design. Each had its own
     special-purpose command language and they were all pretty bad. The
     goal for Tcl was to build a good command language that was also
     reusable, so that I could take advantage of it in all my future
     applications."

When MIMEDefang was first written, it could do exactly one thing:
Quarantine attachments with funny filenames.  But I knew people would
want more, so I made it open-ended.  I think it was the right
decision.

I wrote a language-parser for Remind (http://www.roaringpenguin.com/remind/)
and it's pretty bad.  People who write Remind scripts develop odd little
twitches and tics after a while. :-)

> So I really need to start off with a fresh "mimedefang-filter" file which is
> database (or config file) driven from the start.  I know have a goal!

CanIt really isn't that expensive. :-)

Regards,

David.



More information about the MIMEDefang mailing list