[Mimedefang] Anomy 1.54 w/ MD 2.21
Aaron Paetznick
aaronp at critd.com
Mon Sep 23 15:43:01 EDT 2002
I had the same problem. Here is my modified anomy_clean_html() from my
mimedefang.pl. David, maybe this could be included?
--Aaron
#***********************************************************************
# %PROCEDURE: anomy_clean_html
# %ARGUMENTS:
# entity -- entity to clean. Assumed to be of type text/html
# hash -- hash of arguments for HTML sanitizer constructor
# %RETURNS:
# 0 on failure; 1 on success
# %DESCRIPTION:
# Uses the Anomy Sanitiers HTMLCleaner to sanitize HTML
# See http://mailtools.anomy.net/
#***********************************************************************
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;
my $t;
my $l = "";
return 0 unless defined($entity->bodyhandle);
my $path = $entity->bodyhandle->path;
return 0 unless defined("$path");
unless(open(IN, "<$path")) {
syslog('err', "anomy_clean_html: Could not open body part
$path: $!");
return(0);
}
unless(open(OUT, ">$path.new")) {
close(IN);
syslog('err', "anomy_clean_html: Could not open output part
$path.new: $!");
return(0);
}
####<hack>####
while (<IN>) {
$t = $l . $_ if defined $l;
$l = $cleaner->clean(\$t);
print OUT $t;
}
####</hack>####
close(IN);
close(OUT);
unless (rename("$path.new", "$path")) {
syslog('err', "anomy_clean_html: Could not rename $path.new to
$path: $!");
return(0);
}
$Changed = 1;
return(1);
}
Ashley M. Kirchner wrote:
> Is anyone using that combination of tools, version 1.54 of Anomy-Sanitizer
> and MIMEDefang 2.21? If so, are you by chance also logging the multiplexor?
> I'm getting these slave errors in my log:
>
> sm-mta[17268]: g8NJEV4Z017268: from=<nWeETQCoa0EhV at microsoft.com>, size=27517,
> class=0, nrcpts=1, msgid=<9UnMLMec at pavo.seed.net.tw>, proto=SMTP, daemon=MTA,
> relay=[218.18.13.188]
> mimedefang-multiplexor: Slave 1 stderr: Use of uninitialized value in
> concatenation (.) or string at
> /usr/lib/perl5/site_perl/5.6.1/Anomy/HTMLCleaner.pm line 600, <IN> line 6.
> mimedefang-multiplexor: Slave 1 stderr: Use of uninitialized value in
> concatenation (.) or string at
> /usr/lib/perl5/site_perl/5.6.1/Anomy/HTMLCleaner.pm line 600, <IN> line 90.
> mimedefang-multiplexor: Slave 1 stderr: Use of uninitialized value in
> concatenation (.) or string at
> /usr/lib/perl5/site_perl/5.6.1/Anomy/HTMLCleaner.pm line 600, <IN> line 90.
> mimedefang-multiplexor: Slave 1 stderr: Use of uninitialized value in
> concatenation (.) or string at
> /usr/lib/perl5/site_perl/5.6.1/Anomy/HTMLCleaner.pm line 600, <IN> line 101.
> mimedefang-multiplexor: Slave 1 stderr: Use of uninitialized value in
> concatenation (.) or string at
> /usr/lib/perl5/site_perl/5.6.1/Anomy/HTMLCleaner.pm line 600, <IN> line 111.
>
> etc., etc. It keeps going for a while... I'm pretty sure this is not an
> MD problem (but more of an anomy one), however I wanted to make sure it wasn't
> something I did, before I go bug the anomy folks.
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:ashley at pcraft.com> . 303.442.6410 x130
> IT Director / SysAdmin / WebSmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
>
>
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
More information about the MIMEDefang
mailing list