[Mimedefang] Content filtering withou spamassasin?
Murat Isik
muratisik at megatek.com.tr
Sun Feb 8 18:18:11 EST 2004
Hello,
I am running mimedefang 2.39 on redhat 9.0 and sendmail-8.12.8-9.90. I was
wondering if there is a way to do some content filtering like rejecting the
mail if the body contains some words without spamassain. I tried spamassain
and it takes up too much memory on my server. I found this in the archieves
but could not get it to work as I put it within the filter_begin:
open (IN, "./INPUTMSG") || die "Error opening input message";
while (<IN>) {
chop();
if (/hastalavistababy/) {
# do something
}
}
close(IN);
Can this work? Maybe there is to do than just pasting it into filter_begin.
Also when I asked this question on the list some time ago, a good fellow
send a modifed version as such:
if (open (INF, "./HEADERS")) {
my $bad = 0;
while (my line = <INF>) {
$line =~ s/\n//g;
if ($line =~ /^Subject:\s+.*hastalavistababy.*$/) {
$bad = 1;
last;
}
}
close(INF);
return action_discard('Bad, bad header!') if ($bad);
}
if (open (INF, "./INPUTMSG")) {
my $bad = 0;
while (my line = <INF>) {
$line =~ s/\n//g;
if ($line =~ /hastalavistababy/) {
$bad = 1;
last;
}
}
close(INF);
return action_discard('Bad, bad body!') if ($bad);
}
However this code within the filter_begin produced these erros in the
maillog:
mimedefang-multiplexor: Slave 0 stderr: No such class line at
/etc/mail/mimedefang-filter line 187, near "(my line" syntax error at
/etc/mail/mimedefang-filter line 187, near "my line =" Too many arguments
for main::action_discard at /etc/mail/mimedefang-filter line 195, near
"'Bad, bad header!') " No such class line at /etc/mail/mimedefang-filter
line 200, near "(my line" syntax error at /etc/mail/mimedefang-filter line
200, near "my line =" Too many arguments for main::action_discard at
/etc/mail/mimedefang-filter line 208, near "'Bad, bad bod
Since I am no good at perl, I couldnot find where I am making a mistake.
Anybody have any idea?
Have a nice day.
Murat Isik
More information about the MIMEDefang
mailing list