[Mimedefang] Please try 2.3 Beta 3

Bill Randle billr at outlawnet.com
Wed Jan 9 13:46:19 EST 2002


David F. Skoll wrote:

> Hi,
> 
> I've put up 2.3-BETA-3 at:
> 
> http://www.roaringpenguin.com/mimedefang/mimedefang-2.3-BETA-3.tar.gz
> 
> Please let me know if it fixes the problem some of you have had with
> the multiplexor hanging.  Please run with logging on, too, in case I
> need to diagnose problems.
> 
> Regards,
> 
> David.



I added a little extra code to action_quarantine() to save the new
headers (along with the original headers) to the quaratined message.
This way, if I have any action_add_header() commands in the 
/etc/mail/mimedefang-filter, those headers will be appended to the
<qdir>/HEADERS file and also show up in the automatic email that
gets generated. Where this is most useful is when running something
like spamassassin from filter_begin().

For example, here's part of my mimedefang-filter file, based on
a previous posting by Jeff Heinen:

sub filter_begin {
     my $hits;
     my $req;
     my $names;
     my $report;

     ($hits,$req,$names, $report) = spam_assassin_check();
     action_add_header("X-Spam-Status", "Yes, hits=$hits required=$req 
tests=$names");

     if ($hits > $req) {
	$is_spam = 1;
	action_add_header("X-Spam-Warning", "SpamAssassin says this message is 
SPAM");
     } else {
	$is_spam = 0;

    }
}


sub filter {
     my($entity, $fname, $ext, $type) = @_;

     if ($is_spam)
     {
	action_quarantine($entity, "SpamAssassin says this message is SPAM");
	return action_discard();
     }
	
     return action_accept();
}


In the distributed version of mimedefang.pl, the added header will only
show up in email that is accepted. This patch gets the added header in
any quarantined mail as well. (Line numbers are base on 
MIMEDefang-2.3-BETA-3.)

	-Bill

--- mimedefang.pl.orig	Wed Jan  9 13:07:54 2002
+++ mimedefang.pl	Wed Jan  9 13:12:13 2002
@@ -548,6 +548,16 @@
  		}
  		close(IN);
  	    }
+ 
     if (open(IN, "<NEWHEADERS")) {
+ 
	while(<IN>) {
+ 
	    chomp;
+ 
	    my $header = $_;
+ 
	    my $value = <IN>;
+ 
	    chomp $value;
+ 
	    print OUT "$header: $value\n";
+ 
	}
+ 
	close(IN);
+ 
     }
  	    close(OUT);
  	}
      }






More information about the MIMEDefang mailing list