[Mimedefang] Bounce spam with hit counts between 5-10...

Jamie Pratt jpratt at norwich.edu
Wed May 25 14:46:55 EDT 2005


Hi,

i'm trying to modify mimedefang-filter to BOUNCE spam that has a
hit-count between 5 and 11 (basically, 10 and under so that FP's can be
identified easier.) - Right now, we archive anything tagged as spam, as
our users do not want it either way (evil, yes I know, but I don't make
the rules there...)

I have the filter set up like below , but it didn't seem to work, so I
backed it out - what is the correct way to do this?  should I use
"return action_bounce", or just "action_bounce"? (When i tried the
below, it seemed to not work, and spam was actually let through for
whatever reason.. Guess it isn't exiting properly after the bounce? not
sure... my log moves so fast, it's hard to keep up with... :-(

thanks for any help - still learning perl the hard way! :-(

regards,
jamie


# Spam!!
     if ($hits >= $req ) {
         $is_spam=1;

	#### NEW CODE HERE #####
	if (($hits > 5) && ($hits < 11)) {
		md_graphdefang_log('SPAM BOUNCED', $hits, $names);
	        action_bounce("WARNING: Your email is being returned as 				it
was flagged as SPAM.");
         }

	#### END NEW CODE ####


         md_graphdefang_log('SPAM', $hits, $RelayAddr);
         action_add_header("X-Spam-Score", "$hits ($score) $names");
         # Add a header with original recipients, for info
         action_add_header("X-Orig-Rcpts", join(", ", @Recipients));
         # Remove original recipients
         foreach $recip (@Recipients) {
                 delete_recipient($recip);
         }
         # Send all spam mails to a local acct.
         add_recipient('spam');
         md_graphdefang_log('SPAM TRAPPED', $hits, $names);

     ## ...NOT spam.
    } else {

        # Delete any existing X-Spam-Score header?
        action_delete_header("X-Spam-Score");
        foreach $recip (@Recipients) {
            md_graphdefang_log('SENT - NOTSPAM', $hits, $names);
        }
        action_add_header("X-Spam-Score", "$hits ($score)$names");
        action_add_header("X-Spam-Flag", "NO");
   }





-- 

James Pratt
Unix Systems Administrator
Norwich University
http://www.norwich.edu
<jpratt at norwich.edu> | ph. (802)485-2532



More information about the MIMEDefang mailing list