[Mimedefang] Anomy::HTML

Rich West Rich.West at divatv.com
Mon Jul 8 16:20:02 EDT 2002


I have finally gotten around to tinkering with the Anomy::HTML 
implementation within Mimedefang in order to make it more usable, and I 
had a question for David...

Right now, in sub anomy_clean_html within mimedefang.pl, we have:
sub anomy_clean_html {
    my($entity, $hash);
    $entity = shift;
    $hash = shift;

    unless ($Features{"HTMLCleaner"}) {
        syslog('err', 'Attempt to call anomy_clean_html, but 
Anomy::HTMLCleaner is not installed.');
        return 0;
    }

    if (!$hash) {
        $hash = { };
        $hash->{"Paranoid"} = 1;
        $hash->{"NoWebBugs"} = 1;
    }

    my $cleaner = new Anomy::HTMLCleaner $hash;
 .
 .
 .

And according to the HTMLCleaner.pm Perl module, it has:
sub new
{
    my ($proto, $cfg) = @_;
    my $class = ref($proto) || $proto;
    my $tmp = undef;

    $cfg = { } unless ($cfg);
    my $self = {
        "conf"         => $cfg,
                "log"          => $cfg->{"Log"} || new Anomy::Log,
                "mod_count"    => $cfg->{"ModCounter"} || \$tmp,
                "msg_defanged" => $cfg->{"DefangString"} || "DEFANGED",
                "rules"        => { %{ $attribute_rules } },
                "explained"    => { },
                "html_count"   => 0,
                "style_count"  => 0,
                "style_index"  => 0,
                "styles"       => [ ],
    };
 .
 .
 .

I am wondering if it is possible to pass along the configuration file 
"/etc/mail/mimedefang/sanitizer.cfg" in as part of the call for new 
Anomy::HTMLCleaner.  Of course, $cfg looks to be a hash of some sort, 
but I thought I would ask before I started digging.

This would allow for a seperate file to be used to control the behavior 
of Anomy::HTMLCleaner, and, hence, be used as it was designed.

-Rich


-- 
Richard West                            mailto:richard.west at divatv.com
Sr. Systems Administrator
Diva - Princeton, NJ                    http://www.divatv.com





More information about the MIMEDefang mailing list