[Mimedefang] Modifying Headers Before Milter Does

Roberto Ullfig rullfig at uic.edu
Mon Aug 6 14:59:58 EDT 2007

OK, I've edited spam_assassin_mail like so:

    # Add To: header if one missing
    if (open(IN, "<./HEADERS")) {
    my $hto = grep { /^To:/i } <IN>;
    push(@sahdrs, "To: undisclosed-recipients:;\n") unless $hto;

### new code
    if( $VirusName =~ /Sanesecurity/ )
        md_syslog('info', "$MsgID: *** Inserting X-ClamAV: Virus 
$VirusName ***");
        push(@sahdrs, "X-ClamAV: Virus $VirusName\n");

We later have spamassassin add a score based on this X-ClamAV header. I 
also call action_add_header later on in filter_end (in our 
mimedefang-filter file) if the message is not eventually rejected. 
Interestingly, the header added here in spam_assassin_mail does not 
survive until the end of processing and action_add_header needs to be 
called. Why is that? Everything seems to be working the way we want it.

P.S. How do you reply to this mailman list?

Roberto Ullfig - rullfig at uic.edu

More information about the MIMEDefang mailing list