(none)   anomy-list@mailtools.anomy.net
/ help / lists / applications / search /
 

CODE: Common message data exposed.

From: Bjarni R. Einarsson (
22349@xyz.molar.is)
Date: Thu 20 Sep 2001 - 12:06:03 UTC

  • Next message: Alexander: "nimda and sanitizer"

    One more thing - you mentioned in a previous message that I forgot
    to expose the common data within parsed parts to the rest of the
    program.

    I've added a field to the sanitizer structure named "common", which
    is set to point to the "common" structure within the top level MIMEStream
    parser. So the data will remain accessible even after parsing is
    complete.

    The modifications were minor:

    In Sanitizer::new:

            "base_mod_id" => 0,
            "logd_mod_id" => 0,

    + # Common part data, exposed.
    + "common" => undef,

    In Sanitizer::sanitize:

        # Create MIMEStream object
        my $message = Anomy::MIMEStream->New($fh_in, $fh_out,
                                             $self->WrappedParsers());

    + # Record the common data for use by hooks.
    + $self->{"common"} = $message->{"common"};

    This will also be in the next release.

    So, after sanitizing, this would print out the subject of the original
    message (in sanitizer.pl):

            print $engine->{"common"}->{"headers"}->{"subject"}, "\n";
            
    Check MIMEStream.pm to see what other stuff is available from the
    common structure.

    Is this and the sublog stuff sufficient to allow you to implement
    sender notification without further modifications to MIMEStream.pm
    or Sanitizer.pm?

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

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



  •