I'm having difficulty trying to configure a mimedefang filter that will reject html email at smtp but I keep getting syntax error. My md-filter is short and contains this:

# Detect and load Perl modules
detect_and_load_perl_modules();

sub filter_begin {
   my($entity) = @_;
   if ($FoundHTML  && {
       action_bounce("HTML mail not allowed here.");
       return;
   }
}
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;

the syntax error says:
syntax error at /etc/mail/mimedefang-filter line 8, near "return"
syntax error at /etc/mail/mimedefang-filter line 10, near "}"
Compilation failed in require at /usr/bin/mimedefang.pl line 5257.

I've been on this for ages and getting nowhere so thanks for any help.
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to