anomy-list

Re: Custom extensions to Anomy

From: Bjarni R. Einarsson (19550@xyz.molar.is)
Date: Tue 04 Sep 2001 - 15:44:06 UTC

  • Next message: Bjarni R. Einarsson: "Announcing sanitizer.pl, revision 1.43"

    On 2001-09-04, 10:29:59 (-0500), Sterling Hanenkamp wrote:
    > With some slight modification to the Anomy Sanitizer code it would be
    > possible to add customized extensions without patching the Sanitizer
    > directly. This would make my job *much* easier as I would not have to
    > rehack the scripts directly whenever I wanted to upgrade to the latest
    > version of the Sanitizer. (Or make my boss' job easier since I will
    > probably be in Grad school rather than here in 6 months.)

    This is actually what I started working on soon after receiving
    your first patch. I've got a working (more or less) implementation
    here in CVS, which I suppose I should release soon even though I
    still haven't reimplemented the scoring mechanism.

    I finally cleaned up the Sanitizer and made it a properly OO module,
    so if necessary it is possbile to have multiple Sanitizer objects in
    a single program.

    > Next, upon startup, Sanitizer should load any external Perl modules
    > defined as extensions. I'm not sure how the semantics of passing in
    > information ought to work, but somehow the extensions will need access
    > to the logger and other Sanitizer variables.

    This is IMHO too complicated. Much simpler is to modularize all of
    the sanitizer's features, and have customizations like this be
    simplly dedicated scripts. If you take a look at sanitizer.pl in
    the latest release, you'll see that it is very, very short and
    simple.

    IMHO it makes far more sense to write replacements for
    "sanitizer.pl" which use all the underlying modules and link in
    additions there - kludging that stuff into the configuration system
    will only make the configuration system messy, without providing
    nearly as much flexibility as people will inevitably want.

    This is btw. how I'm using the sanitizer at work (FRISK) - I don't
    actually use the sanitizer.pl script, I just "use Anomy::Sanitizer"
    from the application I'm writing.

    > I suppose that the other possible action an extension might take is to
    > register custom parsers for scanning the email, but I don't know if that
    > would be a good idea since that's messing with the core of the sanitizer.

    It is possible to register custom "virus scanners" already - this is
    exhibited by sanitizer.pl, where John's macro scanner is registered
    on startup. This mechanism probably should be enhanced further, but
    it's a start - it's already powerful enough to allow people to
    register code for translating e.g. .GIF images to .PNG or Word docs
    to HTML...

    > I really like the new log hooks now that I understand how they work.
    > Thanks a lot for the help.

    Cool. :)

    -- 
    Bjarni R. Einarsson                           PGP: 02764305, B7A3AB89
     19550@xyz.molar.is                -><-              http://bre.klaki.net/
    

    Check out my open-source email sanitizer: http://mailtools.anomy.net/



    hosted by molar.is