[Mimedefang] action_bounce html mail

tonj tonj at freeuk.com
Tue Jul 13 07:16:08 EDT 2010


thanks for your feedback on this and I've been using your suggested code in
my md filter for a few days but html mail is still coming through as normal.
This is my md filter:

# Detect and load Perl modules
detect_and_load_perl_modules();

sub filter_begin {
    my($entity, $name, $ext, $type) = @_;
    if ($type =~ /text.html/i) {
        return action_bounce("HTML mail not allowed here, plain text
only.");
    }
}
sub filter_end {
    my($entity) = @_;
    my($hits, $req, $names, $report) = spam_assassin_check();
    my $stars = ($hits < 15) ? ("*" x int($hits)) : ("*" x 15);

    # Bounce anything hitting the spam threshold
    if ($hits >= 5) {
        action_bounce("No spam wanted here.");
        return;
    }

    # Add spam-score header
    action_change_header("X-Spam-Score", "$hits ($stars) $names");
    }
# DO NOT delete the next line, or Perl will complain.
1;

Spam is rejected but not html mail. Perhaps I have done something wrong but
I can't see what it is. Can you see any error or see why the code isn't 
working? 




More information about the MIMEDefang mailing list