[Mimedefang] Deleting spam

Shawn Button sbutton at dtjboulder.com
Thu Aug 29 11:52:01 EDT 2002


Hi. I inserted the code into the mimedefang-filter like you said. It
still continues to allow spam through and only reports over the
threshold instead of dumping it. Did I do something wrong? (snippett):

# Spam checks if SpamAssassin is installed
    if ($Features{"SpamAssassin"}) {
        if (-s "./INPUTMSG" < 100*1024) {
            # Only scan messages smaller than 100kB.  Larger messages
            # are extremely unlikely to be spam, and SpamAssassin is
            # dreadfully slow on very large messages.
            my($hits, $req, $names, $report) = spam_assassin_check();
            if (hits > 13) {
                return action_discard();
            }
            if ($hits >= $req) {
                my($score);
                if ($hits < 40) {
                    $score = "*" x int($hits);
                } else {
                    $score = "*" x 40;
                }
                # We add a header which looks like this:
                # X-Spam-Score: 6.8 (******) NAME_OF_TEST,NAME_OF_TEST
                # The number of asterisks in parens is the integer part
                # of the spam score clamped to a maximum of 40.
                # MUA filters can easily be written to trigger on a
                # minimum number of asterisks...
                action_change_header("X-Spam-Score", "$hits ($score)
$names");

                # If you find the SA report useful, add it, I guess...
                action_add_part($entity, "text/plain", "-suggest",
                                "$report\n",
                                "SpamAssassinReport.txt", "inline");
            }
        }
    }
}

# DO NOT delete the next line, or Perl will complain.
1;

Thanks much,

Shawn




More information about the MIMEDefang mailing list