[Mimedefang] code advice

Andrew Jayes andrew.jayes at visitheartofengland.com
Wed Feb 11 12:18:09 EST 2004


Hi,
	I have the following pieces of code in my defang filter, but
they do not seam to anything.

In filter_end
************************
Sub filter_end ($) {

if ($message_is_spam) {            
# Add a header with original recipients, just for info
action_add_header("X-Orig-Rcpts", join(", ", @Recipients));            
# Remove original recipients            
foreach $recip (@Recipients) {                
	delete_recipient($recip);            
} 
           
# Send to spam address            
add_recipient('spamdrop at mydomain.net');        
}





and in filter_begin
***********************************
sub filter_begin () {

      #subject check
      my($msgSubject);
      my($hfile) = "HEADERS";
      while(<HEADERS>){
 	chomp;
 	$line = $_;
 	$idx = index($line, "Subject: ");
 	if ($idx == 0){
 		$msgSubject = substr($line, 9);
 	}
 }

if ((msgSubject =~ /\bparis Hilton\b/ )) {

#bounce the mail
action_bounce("forbidden subject matter");
}

I am not a perl coder and I'm not to sure how the syntax etc of perl
works. Can anyone tell me what is wrong with the code, typos, syntax,
un-declared variables, anything that will help me get the filter working
properly.

Many thanks

andrew



More information about the MIMEDefang mailing list